<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld/sys.tld" prefix="sys" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>付款申请单</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<div class="Wrapper">
	<c:if test="${lcvCarChange==1}"><span class="requiredSymbol">**【车型及报价方案已变更请核实】**</span></c:if>
        <form id="capPayInfo_form">
            <div class="fieldset1 tabel_col clearFix">
                <div class="caption">
                    <span class="title">基本信息</span>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">首付款代收</div>
                    <div class="field">
                    	<%-- <c:if test="${capPayInfoVO.isFstCol==1}"><span class="requiredSymbol">是</span></c:if>
            			<c:if test="${capPayInfoVO.isFstCol==0}"><span class="requiredSymbol">否</span></c:if> --%>
            			<input type="checkbox" name="isFstCol" id="isFstCol"
                               <c:if test="${capPayInfoVO.isFstCol==1}">checked</c:if>>
                               <span class="requiredSymbol">是</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">首付金额(元)</div>
                    <div class="field">
                        <span id="initPayAmt" class="requiredSymbol"></span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">首付不含咨询费(元)</div>
                    <div class="field">
                        <span id="initFstShowAmt" class="requiredSymbol"></span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">设备款(元)</div>
                    <div class="field">
                        <span id="prdAmt" class="requiredSymbol"></span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">所属事业部</div>
                    <div class="field">
                        <span>${capPayInfoVO.buOrgCdNm}</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">项目类型</div>
                    <div class="field">
                        <span>${capPayInfoVO.prjTypCdNm}</span>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">客户名称</div>
                    <div class="field">
	                    <a href="javascript:showCstDtl(${capPayInfoVO.cstId})" class="link">
                        	<span>${capPayInfoVO.cstNm}</span>
                        </a>
                    </div>
                </div>
                <div class="fieldBox col_33">
		            <div class="label">代扣卡验证状态</div>
		            <div class="field">
		                <span class="requiredSymbol">${audStsCdNm}</span>
		            </div>
		        </div>
                <div class="fieldBox col_33">
                    <div class="label">融资租赁合同号</div>
                    <div class="field">
	                    <a href="javascript:toPrjDetail(${capPayInfoVO.prjId })" class="link">
	                        <span>${capPayInfoVO.contNo}</span>
                        </a>
                    </div>
                </div>
                <div class="fieldBox col_33">
                    <div class="label">支付表号</div>
                    <div class="field">
	                    <a href="javascript:showPrjPrdPaySchDtl()" class="link">
                        	<span>${capPayInfoVO.paySchNo}</span>
                        </a>
					</div>
				</div>
				<div class="fieldBox col_33">
                    <div class="label"><span class="requiredSymbol">上牌信息</span></div>
                    <div class="field">
                    	<c:if test="${spState==1 }">
                        	<span class="requiredSymbol">已上牌</span>
                    	</c:if>
                    	<c:if test="${spState==0 }">
                        	<span class="requiredSymbol">未上牌</span>
                    	</c:if>
                    	<c:if test="${spState==0 && spFlag==1 && isExistSp==1 }">
		                    <a href="javascript:modifySp(${capPayInfoVO.prjPrdDtlId})" class="link">
	                        	<span>修改上牌信息</span>
	                        </a>
                    	</c:if>
                    	<c:if test="${spState==0 && spFlag==1 && isExistSp==0 }">
		                    <a href="javascript:addSp(${capPayInfoVO.prjPrdDtlId})" class="link">
	                        	<span>添加上牌信息</span>
	                        </a>
                    	</c:if>
                    	<c:if test="${spFlag==0 && isExistSp==1 }">
		                    <a href="javascript:showSp(${capPayInfoVO.prjPrdDtlId})" class="link">
	                        	<span>查看上牌信息</span>
	                        </a>
                    	</c:if>
                    </div>
                </div>
                <c:if test="${escFlag==1 }">
	                <div class="fieldBox col_33">
	                    <div class="label"><span class="requiredSymbol">抵押信息</span></div>
	                    <div class="field">
	                    	<c:if test="${dyState==1 }">
	                        	<span class="requiredSymbol">已抵押</span>
	                    	</c:if>
                            <c:if test="${dyState==2 }">
                                <span class="requiredSymbol">无法抵押</span>
                            </c:if>
	                    	<c:if test="${dyState==0 }">
	                        	<span class="requiredSymbol">未抵押</span>
	                    	</c:if>
	                    	<c:if test="${dyState==0 && dyFlag==1 && isExistDy==1 }">
			                    <a href="javascript:modifyDy(${capPayInfoVO.prjPrdDtlId})" class="link">
		                        	<span >修改抵押信息</span>
		                        </a>
	                    	</c:if>
	                    	<c:if test="${dyState==0 && dyFlag==1 && isExistDy==0 }">
			                    <a href="javascript:addDy(${capPayInfoVO.prjPrdDtlId})" class="link">
		                        	<span >添加抵押信息</span>
		                        </a>
	                    	</c:if>
	                    	<c:if test="${dyFlag==0 && isExistDy==1 }">
			                    <a href="javascript:showDy(${capPayInfoVO.prjPrdDtlId})" class="link">
		                        	<span >查看抵押信息</span>
		                        </a>
	                    	</c:if>
	                    </div>
	                </div>
                </c:if>
                <c:if test="${isAuditNode==1 && insCode!='czbank' && insCode!='snbank' }">
	                <c:if test="${prjTypCd=='DSFZGCP' || prjTypCd=='DSFZGCT' || isInsBiz=='1'}">
						<c:if test="${sendStatus=='success' }">
							<div class="fieldBox col_33">
								<div class="label">
									<c:if test="${insCode=='czbank' }">创建客户信息结果</c:if>
									<c:if test="${insCode!='czbank' }">征信查询结果</c:if>
								</div>
								<div class="field">
								    <span>
								    	<c:if test="${auditResult=='pending' }">待处理</c:if>
										<c:if test="${auditResult=='pass' }">通过</c:if>
										<c:if test="${auditResult=='reject' }">拒绝/驳回</c:if>
										<c:if test="${auditResult=='quit' }">放弃/退出</c:if>
										<c:if test="${auditResult=='unknown' }">其他/未知</c:if>
								    </span>
								</div>
							</div>
						</c:if>
		                <c:if test="${sendStatus!='success' }">
		                	<div class="fieldBox col_33">
								<c:if test="${insCode=='czbank' }">创建客户信息发送结果</c:if>
								<c:if test="${insCode!='czbank' }">提交征信结果</c:if>
								<div class="field">
									<span>${sendStatusNm }</span>
									<a href="javascript:submitCredit()" class="link">
				                    	<span>
				                    		<c:if test="${insCode=='czbank' }">创建客户信息发送到浙商</c:if>
											<c:if test="${insCode!='czbank' }">提交征信</c:if>
				                    	</span>
									</a>
								</div>
							</div>
		                </c:if>
					</c:if>
				</c:if>
				<!-- 工行完善版上线,工行支付表和上装支付表在同一个流程中,设置还款日只需设置工行的会一起生成上装的 -->
				<!-- (所以controller里校验了上装产品就不显示设置还款日),但是之前的上装流程中也是上装产品, -->
				<!-- 已经在流程中的还是需要开放设置还款日的所以加了判断节点KEY的条件解决 -->
				<c:if test="${saveDueDate==1 || taskDefKey=='FLOW_00000001_001_005_008'}">
					<div class="fieldBox col_50">
						<div class="label">第一期还款日</div>
						<div class="field">
							<input type="text" id="dueDate" name="dueDate" class="ui-datepicker" value="${dueDate }" validate=""/>
				        	<span id="addDueDt_Btn" class="sq-button sq-button-round" onclick="addDueDate();">保存还款日</span>
						</div>
<!-- 				    	<div class="fieldset1 clearFix">
					        <div class="btnsBox" style="text-align: center;">
						    </div>
					    </div> -->
					</div>
				</c:if>
	            <div class="fieldBox col_100">
		            <div class="label">是否团单</div>
		            <div class="field">
		            	<select name="isGrp" id="isGrp" data-value=" ">
		                	<option value=" " selected="selected">请选择</option>
		                	<c:forEach items="${isGrpList }" var="kv">
								<option value="${kv.key }">${kv.value }</option>
							</c:forEach>
						</select>
		            </div>
		        </div>
					<div class="fieldBox col_33">
						<div class="label">是否外部机构放款</div>
						<div class="field">
							<select name="isOutInsLoan" id="isOutInsLoan" value="${isOutInsLoan}">
								<option value=" " selected="selected">请选择</option>
								<c:forEach items="${yesOrNOList }" var="kv">
									<c:if test="${kv.key == isOutInsLoan}">
										<option value="${kv.key}" selected="selected">${kv.value}</option>
									</c:if>
									<c:if test="${kv.key != isOutInsLoan}">
										<option value="${kv.key}">${kv.value}</option>
									</c:if>
								</c:forEach>
							</select>
							<span class="requiredSymbol">*</span>
						</div>
					</div>
					<div class="fieldBox col_33" id="loanInsCodeDiv">
						<div class="label">放款机构名称</div>
						<div class="field">
							<select name="loanInsCode" id="loanInsCode" value="${loanInsCode}">
								<c:if test="${loanInsCode == null || loanInsCode == ''}">
									<option value="" selected="selected">--请选择--</option>
								</c:if>
								<c:if test="${loanInsCode != null && loanInsCode != ''}">
									<option value="">--请选择--</option>
								</c:if>
								<c:forEach items="${friBaseList}" var="fri">
									<c:if test="${fri.insCode == loanInsCode}">
										<option value="${fri.insCode}" selected="selected">${fri.fundRasInsNm}</option>
									</c:if>
									<c:if test="${fri.insCode != loanInsCode}">
										<option value="${fri.insCode}">${fri.fundRasInsNm}</option>
									</c:if>
								</c:forEach>
							</select>
							<span class="requiredSymbol">*</span>
						</div>
						</div>
					<div class="fieldBox col_33" id="insLoanTmDiv">
					<div class="label">机构放款时间</div>
						<div class="field">
							<input name="insLoanTm" id="insLoanTm" type="text" class="ui-datepicker" value="${insLoanTm}">
							<span class="requiredSymbol">*</span>
						</div>
					</div>
					<div class="fieldBox col_33" id="insLoanSumDiv">
						<div class="label">机构放款金额</div>
						<div class="field">
							<input name="insLoanSum" id="insLoanSum" type="text" class="ui-textbox" value="${insLoanSum}">
							<span class="requiredSymbol">*</span>
						</div>
					</div>
	            <div class="fieldBox col_100" <c:if test="${mdfIsOtherNoPass!=1 }">style="display: none"</c:if>>
		            <div class="label">除"商家必要资料"外是否有不合规信息<span class="requiredSymbol">(驳回必选)</span></div>
		            <div class="field">
		            	<select name="isOtherNoPass" id="isOtherNoPass" data-value=" ">
		                	<option value=" " selected="selected">请选择</option>
		                	<c:forEach items="${yesOrNOList }" var="kv">
								<option value="${kv.key }">${kv.value }</option>
							</c:forEach>
						</select>
		            </div>
		        </div>
		    	<c:if test="${hjzxFlag==1 || mdfIsOtherNoPass==1}">
			    	<div class="fieldset1 clearFix">
				        <div class="btnsBox" style="text-align: center;">
					        	<span id="saveIsGrp_Btn" class="sq-button sq-button-round" onclick="saveIsGrp_Btn();">保存</span>
					    </div>
				    </div>
		    	</c:if>
				<c:if test="${buOrgCd == '00000014'}">
					<div class="caption">
						<span class="title">担保人信息</span>
						<div class="btnsBox inLC">
							<!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -->
							<c:if test="${isAuditNode==1}">
							<span id="addNpGuarBtnLcv" class="sq-button sq-button-round" onclick="addNpGuarLcv();">
										添加
									</span>
							</c:if>
						</div>
					</div>
					<div id="guarantor" class="fieldBox col_100">
						<div class="sqPanel">
							<div class="sqPanel_body">
								<div id="ligergrid_guarantor_lcv" class="sq-grid"></div>
							</div>
						</div>
					</div>
				</c:if>
				<c:if test="${saveOrgBizOpnCd==1 && insCode=='spdbank'}">
					<div class="fieldBox col_50">
						<div class="label">三方业务处理意见</div>
						<div class="field">
							<select name="orgBizOpnCd" id="orgBizOpnCd" data-value="${prjBscExtDTO.orgBizOpnCd }">
								<option value=" " selected="selected">请选择</option>
								<c:forEach items="${orgBizOpnCdList }" var="kv">
									<option value="${kv.key }">${kv.value }</option>
								</c:forEach>
							</select>
						</div>
					</div>
					<div class="fieldBox col_50">
						<div class="label">三方审核通过时间</div>
						<div class="field">
							<span name="orgCreditMdfTm" id="orgCreditMdfTm"><fmt:formatDate value="${prjBscExtDTO.orgCreditMdfTm}" pattern="yyyy-MM-dd" /></span>
						</div>
					</div>
			    	<div class="fieldset1 clearFix">
				        <div class="btnsBox" style="text-align: center;">
					        	<span id="save_orgBizOpnCd" class="sq-button sq-button-round" onclick="saveOrgBizOpnCd();">保存处理意见</span>
					    </div>
				    </div>
		    	</c:if>
                <c:if test="${gpsFlag == 1}">
                    <div class="fieldBox col_33">
                        <div class="label">是否需要安装有线GPS</div>
                        <div class="field">
                            <span class="requiredSymbol" style="color: red">需装</span>
                        </div>
                    </div>
                </c:if>
                <c:if test="${gpsFlag == 2}">
                    <div class="fieldBox col_33">
                        <div class="label">是否需要安装有线GPS</div>
                        <div class="field">
                            <span class="requiredSymbol" style="color: green">免装</span>
                        </div>
                    </div>
                </c:if>
				<c:if test="${capPayInfoVO.buOrgCd == '00000013' && (capPayInfoVO.prjTypCd=='CPYW' || capPayInfoVO.prjTypCd=='ZCSS')}">
					<div class="fieldBox col_33">
						<div class="label">挂靠公司名下未抵押车辆信息</div>
						<div class="field">
							<span class="requiredSymbol">${noPassAudCarNum}</span>
						</div>
					</div>
					<div class="fieldBox col_33">
						<div class="label">供应商名下未抵押车辆信息</div>
						<div class="field">
							<span class="requiredSymbol">${noSplPassNum}</span>
						</div>
					</div>
				</c:if>
				<c:if test="${capPayInfoVO.buOrgCd == '00000001' || capPayInfoVO.buOrgCd == '00000008'}">
					<div class="fieldBox col_100">
						<div class="label">风控决策系统（CDS）结果</div>
						<div class="field">
						<span name="auditInfo" id="auditInfo">
								${auditInfo }
						</span>
						</div>
					</div>
				</c:if>
				<c:if test="${buOrgCd == '00000014' && isAuditNode == 1}">
					<div class="fieldBox col_100">
						<div class="label">CDS风控决策结果</div>
						<div class="field">
						<span name="auditInfo" id="auditInfo">
								${auditInfo }
						</span>
						</div>
					</div>
				</c:if>
				<div class="fieldBox col_100">
					<div class="label">客户风险标记</div>
					<div class="field">
						<span name="rskCstSignDesc" id="rskCstSignDesc"  style="color: red">
							${rskCstSignDesc}
						</span>
					</div>
				</div>
				<div class="fieldBox col_100">
					<div class="label">担保人风险标记</div>
					<div class="field">
						<span name="rskGuarSignDesc" id="rskGuarSignDesc"  style="color: red">
							${rskGuarSignDesc}
						</span>
					</div>
				</div>
				<div class="fieldBox col_100">
					<div class="label">设备风险标记</div>
					<div class="field">
						<span name="rskProdSignDesc" id="rskProdSignDesc"  style="color: red">
							${rskProdSignDesc}
						</span>
					</div>
				</div>
				<div class="fieldBox col_100">
					<div class="label">Vin风险标记</div>
					<div class="field">
                        <span name="rskVinSignDesc" id="rskVinSignDesc"  style="color: red">
							${rskVinSignDesc}
						</span>
					</div>
				</div>
				<div class="fieldBox col_100">
					<div class="label">挂靠公司风险标记</div>
					<div class="field">
                        <span name="rskLnkSignDesc" id="rskLnkSignDesc"  style="color: red">
							${rskLnkSignDesc}
						</span>
					</div>
				</div>
				<div class="fieldBox col_100">
					<div class="label">供应商风险标记</div>
					<div class="field">
                        <span name="rskSplSignDesc" id="rskSplSignDesc"  style="color: red">
							${rskSplSignDesc}
						</span>
					</div>
				</div>
				<div class="fieldBox col_100">
					<div class="label">手机号风险标记</div>
					<div class="field">
                        <span name="rskCstMpSignDesc" id="rskCstMpSignDesc"  style="color: red">
							${rskCstMpSignDesc}
						</span>
					</div>
				</div>
		    	<div class="fieldBox col_100">
		            <div class="label">合同签署方式</div>
		            <div class="field">
		            	<select name="cntTypCd" id="cntTypCd" data-value="${cntTypCd }">
		                	<option value=" " selected="selected">请选择</option>
		                	<c:forEach items="${cntTypCdList }" var="kv">
								<option value="${kv.key }">${kv.value }</option>
							</c:forEach>
						</select>
		            </div>
		        </div>

		        <!-- begin add 信审遗留问题 by JL 20190819 -->
				<div class="fieldBox col_100">
					<div class="label" role="textclip">信审遗留问题</div>
					<div class="field">
						<textarea id="audRemainPro" name="audRemainPro" rows="2" class="ui-textarea l-textarea" style="width:96%"></textarea>
					</div>
				</div>
				<c:if test="${mdf_AudRemainPro==1}">
					<div class="fieldset1 clearFix">
				        <div class="btnsBox" style="text-align: center;">
					        <span id="saveAudRemainPro" class="sq-button sq-button-round" onclick="saveAudRemainPro();">保存信审遗留问题</span>
					    </div>
				    </div>
		        </c:if>
				<!-- end add 信审遗留问题 by JL 20190819 -->
				<c:if test="${guaraStatus == 2}">
                    <div class="caption">
                        <span class="title">担保人信息</span>
                    </div>
                    <div id="guarantor" class="fieldBox col_100">
                        <div class="sqPanel">
                            <div class="sqPanel_body">
                                <div id="ligergrid_guarantor" class="sq-grid"></div>
                            </div>
                        </div>
                    </div>
                </c:if>

                <c:if test="${isAuditNode==1}">
                    <c:if test="${splRiskWarnCd==1}">
                        <div class="fieldBox col_33">
                            <div class="label">供应商预警状态</div>
                            <div class="field">
                                <span style='color:red'>高风险预警</span>
                            </div>
                        </div>
                    </c:if>
                    <c:if test="${lnkRiskWarnCd==1}">
                        <div class="fieldBox col_33">
                            <div class="label">挂靠公司预警状态</div>
                            <div class="field">
                                <span style='color:red'>高风险预警</span>
                            </div>
                        </div>
                    </c:if>
                </c:if>
		    	 <div class="fieldBox col_100" id="pledgee">
		            <div class="label">抵押权人修改</div>
		            <div class="field" >
		            	<select name="pledgeeAuthNm" id="pledgeeAuthNm" data-value="${pledgeeAuthNm }" >
		                	<c:forEach items="${pledgeeNmList }" var="kv">
		                		<c:if test="${pledgeeAuthNm == kv.key }">
								<option value="${kv.key }" selected>${kv.value }</option>
								</c:if>
								<c:if test="${pledgeeAuthNm != kv.key }">
								<option value="${kv.key }">${kv.value }</option>
								</c:if>
							</c:forEach>
						</select>
		                <span id="addpledgeeAuthNmBtn" class="sq-button sq-button-round" onclick="addpledgeeAuthNm();" class="sq-button sq-button-round">保存</span>
		       		 </div>
		         </div>
		        <c:if test="${procNm =='重卡正常放款流程' || procNm =='重卡提前放款流程' || procNm =='重卡提前放款流程（需上牌）' || procNm =='重卡特殊放款流程'}">
		        <div class="fieldBox col_100">
					<div class="sqPanel">
		                <div class="sqPanel_head inL">
		                    <div class="btnsBox inLC">
		                        <span id="addBtn" class="sq-button sq-button-round" onclick="addLinkManRow();">添加</span>
		                        <span id="addLinkManBtn" class="sq-button sq-button-round" onclick="addLinkMan();" class="sq-button sq-button-round">保存</span>
		                        <span id="delBtn" class="sq-button sq-button-round" onclick="delLinkMan();">删除</span>
		                    </div>
		                    <span>第三方紧急联系人</span>
		                </div>
		                <div class="sqPanel_body">
		                    <div id="prjLinkManGrid" class="sq-grid"></div>
		                </div>
					</div>
				</div>
				</c:if>
		        <c:if test="${mdfCntTypCd==1 }">
			        <div class="fieldset1 clearFix">
				        <div class="btnsBox" style="text-align: center;">
					        	<span id="saveCntTypCd" class="sq-button sq-button-round" onclick="saveCntTypCd();">保存</span>
					    </div>
				    </div>
		        </c:if>
			</div>
            <div>
                <div id="pageInTab" class="pageInTab">
                	<div tabid="payTab" title="付款通知" lselected="true">
                        <c:forEach var="accItem" items="${payeeList}">
                            <div class="fieldset1 tabel_col clearFix">
                                <div class="caption">
                                    <span class="title">${accItem.purpCdNm}信息</span>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">收款方类型</div>
                                    <div class="field">
                                        <input name="payeeTypCd${accItem.purpCd}" id="payeeTypCd${accItem.purpCd}"
                                               data-value="${accItem.payeeTypCd}" validate="{required:true}"
                                               placeholder="请选择" ltype="combobox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>

                                <div class="fieldBox col_66">
                                    <div class="label">收款单位</div>
                                    <div class="field">
                                        <input name="rcptUnt${accItem.purpCd}" id="rcptUnt${accItem.purpCd}"
                                               data-value="${accItem.rcptUnt}" validate="{required:true}" type="text"
                                               class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">账户类型</div>
                                    <div class="field">
                                        <input name="bkAccTypCd${accItem.purpCd}" id="bkAccTypCd${accItem.purpCd}"
                                               data-value="${accItem.bkAccTypCd}" validate="{required:true}"
                                               placeholder="请选择" ltype="combobox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_66">
                                    <div class="label">开户行</div>
                                    <div class="field">
                                        <input name="payeeBkNm${accItem.purpCd}" id="payeeBkNm${accItem.purpCd}"
                                               data-value="${accItem.payeeBkNm}" validate="{required:true}" type="text"
                                               class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">开户行号</div>
                                    <div class="field">
                                        <input name="payeeBkNo${accItem.purpCd}" id="payeeBkNo${accItem.purpCd}"
                                               data-value="${accItem.payeeBkNo}" validate="{required:true,number:true}"
                                               type="text" class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                </div>
                                <div class="fieldBox col_66">
                                    <div class="label">收款账号</div>
                                    <div class="field">
                                        <input name="accNo${accItem.purpCd}" id="accNo${accItem.purpCd}"
                                               data-value="${accItem.accNo}" validate="{required:true,number:false}"
                                               type="text" class="ui-textbox">
                                        <span class="requiredSymbol">*</span>
                                    </div>
                                    <input id="payeeId${accItem.purpCd}" type="text" style="display: none;"
                                           value="${accItem.id}">
                                    <input id="bkId${accItem.purpCd}" type="text" style="display: none;"
                                           value="${accItem.bkId}">
                                    <input id="purpCd${accItem.purpCd}" type="text" style="display: none;"
                                           value="${accItem.purpCd}">
                                </div>
                            </div>
                        </c:forEach>

                        <div class="fieldset1 tabel_col clearFix">
                            <div class="fieldBox col_100">
                                <div class="label">付款备注</div>
                                <div class="field">
                                      <textarea name="payRem" id="payRem" class="ui-textarea l-textarea"
                                                value="${capPayInfoVO.payRem}"
                                                rows="2" cols="120" style="width: 97%;"
                                                validate="{required:false,maxlength:240}">${capPayInfoVO.payRem}</textarea>
                                </div>
                            </div>
                        </div>

                        <c:forEach var="accItem" items="${payeeList}">
                            <div class="fieldset1 tabel_col clearFix">
                                <div class="caption">
                                    <span class="title">付款信息(${accItem.purpCdNm})</span>
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">应付款金额(元)</div>
                                    <div class="field">
                                        <%-- <input name="payAmts${accItem.purpCd}" id="payAmts${accItem.purpCd}"
                                               class="ui-textbox" value="" type="text" data-value="${accItem.payAmts}"
                                               data-tofix="2" validate="{required:true,number:true}" readonly> --%>
                                        <input name="payAmt${accItem.purpCd}" id="payAmt${accItem.purpCd}" 
                                        	data-tofix="2" class="ui-textbox" type="text" data-value="${accItem.payAmts}" 
                                        	validate="{required:false,number:true}" disabled>
                                        	<c:if test="${installment == 1 && accItem.purpCd == 1}"><font color="red">已扣除保险首付款</font></c:if>
                                        <%-- <input id="rebateAmt${accItem.purpCd}" type="text" value="${accItem.rebateAmt}"
                                               style="display: none;"> --%>
                                    </div>
                                </div>
                                <c:if test="${installment == 1 && accItem.purpCd == 1}">
	                                <div class="fieldBox col_33">
	                                    <div class="label">车贷付款金额(元)</div>
	                                    <div class="field">
	                                        <input name="amountPayableq${accItem.purpCd}" id="amountPayableq${accItem.purpCd}" 
	                                        	data-tofix="2" class="ui-textbox" type="text" data-value="${amountPayableq}" 
	                                        	validate="{required:false,number:true}" disabled>
	                                    </div>
	                                </div>
                                </c:if>
                                <div class="fieldBox col_33">
                                    <div class="label">付款方式</div>
                                    <div class="field">
                                        <input id="payWayCd${accItem.purpCd}" data-value="${accItem.payWayCd}"
                                               validate="{required:false}" placeholder="请选择" ltype="combobox">
                                        <c:if test="${accItem.isSended==1 }"><span class="requiredSymbol">*此付款信息已发送网银</span></c:if>
                                    </div>
                                    <input id="isSended${accItem.purpCd}" type="text" style="display: none;"
                                       value="${accItem.isSended}">
                                </div>
                                <div class="fieldBox col_33">
                                    <div class="label">实付金额(元)</div>
                                    <div class="field">
                                        <input id="actPayAmt${accItem.purpCd}" type="text" class="ui-textbox"
                                               data-tofix="2" data-value="${accItem.actPayAmts}"
                                               validate="{required:false,number:true}" disabled>
                                    </div>
                                </div>
                                <c:if test="${installment == 1 && accItem.purpCd == 1}">
									<div class="fieldBox col_33">
	                                    <div class="label">保险分期首期款(元)</div>
	                                    <div class="field">
	                                        <input name="firstAmt${accItem.purpCd}" id="firstAmt${accItem.purpCd}" 
	                                        	data-tofix="2" class="ui-textbox" type="text" data-value="${firstAmt}" 
	                                        	validate="{required:false,number:true}" disabled>
	                                    </div>
	                                </div>
                                </c:if>
                                <div class="fieldBox col_33">
                                    <div class="label">实付时间</div>
                                    <div class="field">
                                        <input id="actPayTms${accItem.purpCd}" type="text" class="ui-datepicker"
                                               value="${accItem.actPayTms}"
                                               validate="{required:false}">
                                    </div>
                                </div>
								<c:if test="${accItem.purpCd == '1'}">
									<div id="payerAccNoDiv">
										<div class="fieldBox col_33">
											<div class="label">付款账户</div>
											<div class="field">
												<input id="payerAccNo" name="payerAccNo" data-value="${accItem.payerAccNo}" placeholder="--请选择--" ltype="combobox">
											</div>
										</div>
										<div class="fieldBox col_33">
											<div class="label">开户行</div>
											<div class="field">
												<input id="payerBkNm" name="payerBkNm" data-value="${accItem.payerBkNm}" placeholder="--请选择--" ltype="combobox">
											</div>
										</div>
									</div>
								</c:if>
                            </div>
                        </c:forEach>
                        <c:if test="${installment == 1}">
                            <div class="fieldset1 tabel_col clearFix">
                                <div class="caption">
                                    <span class="title">保险分期放款账号信息</span>
                                </div>
                                <div class="fieldBox col_33">
	                                    <div class="label">应付款金额(元)</div>
	                                    <div class="field">
	                                        <input name="amountPayable" id="amountPayable" 
	                                        	data-tofix="2" class="ui-textbox" type="text" data-value="${totalAmt}" 
	                                        	validate="{required:false,number:true}" disabled>
	                                    </div>
	                            </div>
                                <div class="fieldBox col_33">
                                    <div class="label">收款单位</div>
                                    <div class="field">
                                        <input id="compNm" type="text" class="ui-textbox"
                                               data-tofix="2" data-value="${insApplicationVO.compNm}"
                                               validate="{required:false,number:true}" disabled>
                                        <span class="requiredSymbol">*</span>
                                    </div>
                               	</div>
                               	
                               	<div class="fieldBox col_33">
									<div class="label">账户类型</div>
							            <div class="field">
							                <select name="isAnchored" id="isAnchored" data-value="0" validate="{required:true,select:true}" disabled="disabled">
													<option value="0">对公</option>
							                </select>
							                <span class="requiredSymbol">*</span>
							            </div>
								</div>
                               	<div class="fieldBox col_33">
                                    <div class="label">开户行</div>
                                    <div class="field">
                                        <input id="bkNm" type="text" class="ui-textbox"
                                               data-tofix="2" data-value="${insApplicationVO.bkNm}"
                                               validate="{required:false,number:true}" disabled>
                                         <span class="requiredSymbol">*</span>
                                    </div>
                               	</div>
                               	<div class="fieldBox col_33">
                                    <div class="label">开户行号</div>
                                    <div class="field">
                                        <input id="bkNo" type="text" class="ui-textbox"
                                               data-tofix="2" data-value="${insApplicationVO.bkNo}"
                                               validate="{required:false,number:true}" disabled>
                                         <span class="requiredSymbol">*</span>
                                    </div>
                               	</div>
                               	<div class="fieldBox col_33">
                                    <div class="label">收款账号</div>
                                    <div class="field">
                                        <input id="accNo" type="text" class="ui-textbox"
                                               data-tofix="2" data-value="${insApplicationVO.accNo}"
                                               validate="{required:false,number:true}" disabled>
                                         <span class="requiredSymbol">*</span>
                                    </div>
                               	</div>
                            </div>
                        </c:if>
                    </div>
                    <div tabid="leaseTab" title="租赁物信息(${capPayInfoVO.prdCount})">
                        <iframe frameborder="0" id="lease" name="lease" src=""></iframe>
                    </div>
                    <div tabid="hisTab" title="历史付款记录(${capPayInfoVO.payCount})">
                        <iframe frameborder="0" id="hispay" name="hispay" src=""></iframe>
                    </div>
                    <div tabid="mateTab" title="放款资料(${capPayInfoVO.fileCount})">
                        <iframe frameborder="0" id="material" name="material" src=""></iframe>
                    </div>
                    <div tabid="insTab" title="查看保单">
                        <iframe frameborder="0" id="insDtl" name="insDtl" src=""></iframe>
                    </div>
                    <div tabid="certTab" title="合格证">
                        <iframe frameborder="0" id="certDtl" name="certDtl" src=""></iframe>
                    </div>
                    <div tabid="invoiceTab" title="发票">
                        <iframe frameborder="0" id="invoiceDtl" name="invoiceDtl" src=""></iframe>
                    </div>
                    <div tabid="insTabA" title="查看分期申请">
                        <iframe frameborder="0" id="insFq" name="insFq" src=""></iframe>
                    </div>
                    <c:if test="${QZTX==1}">
                    	<div tabid="startRentTab" title="起租提醒">
                        	<iframe frameborder="0" id="startRent" name="startRent" src=""></iframe>
                    	</div>
                    </c:if>
					<c:if test="${isShowLoanTab == '1'}">
					<div tabid="loanTab" title="资方放款结果">
						<iframe frameborder="0" id="loanResult" name="loanResult" src=""></iframe>
					</div>
					</c:if>

					<%--展示银行信息采集：所属机构为建行 ccbank时，
					当前合同号下其余支付表号放款状态都不是“未申请”或者“放款失败”的时候，放款申请显示银行信息采集标签页--%>
					<c:if test="${isShowAccTab == '1'}">
						<div tabid="AccTab" title="银行信息采集">
							<iframe frameborder="0" id="accInsCfg" name="accInsCfg" src=""></iframe>
						</div>
					</c:if>

                </div>
            </div>
            <div class="btnsBox">
           		<%-- <c:if test="${kjshFlag==1 || confirmPay==1}">
	        		<span id="savePayAmt_Btn" class="sq-button sq-button-round" onclick="savePayAmt_Btn();">修改应付金额</span>
	        	</c:if> --%>
	        	<c:if test="${kjshFlag==1 || confirmPay==1 || btnFlag==1 || updInsLoan==1 || updInsLoan == '2' }">
	        		<span id="savePayeeInfo_Btn" class="sq-button sq-button-round" onclick="savePayeeInfo_Btn();">保存</span>
	        	</c:if>
                <c:if test="${confirmPay==1}">
	        		<span id="savePayAmt_Btn" class="sq-button sq-button-round" onclick="cancelPay(${capPayId});">取消放款</span>
					<span style="color: red;">  取消后无法恢复!</span>
	        	</c:if>
	        	<!-- <div id="sendPayDIV" style="display:none;"> -->
	        	<%-- <c:if test="${isAllowSendPay==1 }"> --%>
		        	<span id="sendPayDIV" style="display:none;" class="sq-button sq-button-round" onclick="toSendPay();">保存并发送付款单到资金系统</span>
	        	<%-- </c:if> --%>
		    	<c:if test="${hjzxFlag==1 || confirmPay==3}">
		        	<span id="contractOpn" class="sq-button sq-button-round" onclick="contractOpnStart();">放款合同通过意见</span>
		    	</c:if>
		    	<c:if test="${xsFlag==1}">
		        	<span id="mortGageOpn" class="sq-button sq-button-round" onclick="mortGageOpnStart();">放款抵押通过意见</span>
		    	</c:if>
		    	<c:if test="${hjzxFlag==1 || xsFlag==1 || bhFlag==1 || confirmPay==3}">
		        	<span id="rejOpn" class="sq-button sq-button-round" onclick="rejOpnStart();">驳回意见</span>
		    	</c:if>
		    	<c:if test="${procNm =='重卡正常放款流程' || procNm =='重卡提前放款流程' || procNm =='重卡提前放款流程（需上牌）' || procNm =='重卡特殊放款流程'}">
		    	 <c:if test="${returnvisit == 1 }">
					<span id="" class="sq-button sq-button-round" onclick="toFlowVisitAdd();">后续回访记录</span>
				</c:if>
				</c:if>
                <c:if test="${isAuditNode == 1 }">
					<sys:funcAuth resCd="knowledgeGraph">
                    	<span id="visual" class="sq-button sq-button-round" onclick="visual();" >关联图谱</span>
					</sys:funcAuth>
                </c:if>
				<%-- <c:if test="${returnvisit != 1 }">
					<span id="" class="sq-button sq-button-round" onclick="LookFlowVisitAdd();">查看后续回访记录</span>
				</c:if> --%>
		        <input type="reset" id="resetBtn" class="l-button l-button-reset Hide">
		    </div>
		    <input name="cstId" id="cstId" type="text" style="display: none;" value="${capPayInfoVO.cstId}">
            <input name="splId" id="splId" type="text" style="display: none;" value="${capPayInfoVO.splId}">
			<c:if test="${setLeaseData==1}">
				<div class="fieldBox col_50">
					<div class="label">设置起租日</div>
					<div class="field">
						<input type="text" id="leaseDate" name="leaseDate" class="ui-datepicker" value="${leaseDate }" validate=""/>
						<span id="addLeaseDt_Btn" class="sq-button sq-button-round" onclick="addLeaseDate();">保存起租日</span>
					</div>
				</div>
			</c:if>
        </form>
</div>

<script>
var _capPayId = '${capPayId}';//付款信息ID
var _proIntId = '${proIntId}';//流程实例ID
var _taskId = '${taskId}';//任务节点ID
var _taskDefKey = '${taskDefKey}';//任务节点KEY
var _taskNm = '${taskNm}';//任务节点名称
var procNm = '${procNm}';//流程名称
var _isAuditNode = '${isAuditNode}';//是否信审节点标识
var isAdvBiz = '${isAdvBiz}';
var checkSpPass = '${checkSpPass}';
var checkDyPass = '${checkDyPass}';
var updInsLoan = '${updInsLoan}';
var buOrgCd = '${buOrgCd}';


    var pageInTab = null;
    var pageInApp = {};
    var loadedTabs = [];
    var fields = ['payeeTypCd', 'rcptUnt', 'bkAccTypCd', 'payeeBkNm', 'payeeBkNo', 'accNo', 'payeeId', 'bkId', 'purpCd', 'payAmt', 'actPayAmt', 'actPayTms', 'payWayCd'];
    var form = null;
    var counts = [];
    var bizFlag = '${bizFlag}';
    
    var payeeTypCdList=[];
    <c:if test="${not empty payeeTypCdList}">
    	payeeTypCdList = ${payeeTypCdList};//收款方类型
	</c:if>
    var bkAccTypCdList=[];
    <c:if test="${not empty bkAccTypCdList}">
    	bkAccTypCdList = ${bkAccTypCdList};//收款账号类型
	</c:if>
    var payWayCdList=[];
    <c:if test="${not empty payWayCdList}">
    	payWayCdList = ${payWayCdList};//付款方式类型
	</c:if>
	var prjId = '${prjId}';//项目id
	var EmergencyContact = '${EmergencyContact}';//紧急联系人标识
	var authNm = '${authNm}';//抵押权人修改标识
	var prjPrdDtlId = '${prjPrdDtlId}';//项目产品明细id
	var genderCdList = [];
	<c:if test="${not empty genderCdList}"> genderCdList = ${genderCdList}; </c:if>
	var rlCdArr =[];
	rlCdArr = ${rlCdList};
	//担保人信息操作按钮展示状态
    var guaraStatus = '${guaraStatus}';
    if (guaraStatus==2){
        initGuarantorList();//初始化担保人列表
    }
	var guaraStatusLcv = '${guaraStatusLcv}';
    if(buOrgCd == '00000014'){
		initGuarantorListLcv();
	}
	initPledgeeAuthNm();

$("#payerAccNo").ligerComboBox({
	valueField: 'key',
	textField: 'value',
	width:150
});

$("#payerBkNm").ligerComboBox({
	valueField: 'key',
	textField: 'value',
	width:150
});
	//设置抵押权人名称的默认值
	/* function select (){
		("#pledgee select").each(function (){
			 $(this).find("option").eq("1").prop("selected",true) 
		})
	} */
	function initPledgeeAuthNm(){
     	//默认页面上抵押权人修改是隐藏状态
     	$("#pledgee").hide();
     	$("#addpledgeeAuthNmBtn").hide();
     	if('${authNm}'==1){
     		$("#pledgee").show();
         	$("#addpledgeeAuthNmBtn").show();
         	/* if(authNm !='1'){
         		liger.get("opens_select").setDisabled(true);
         	} */
     	}
     }

function setPayerAccNoData(_loanInsCode,payerBkNmMap){
	var url = '<%=path%>/rfbase/fribaseinfo/getBankAccInfoList.do';
	var params = {insCode: _loanInsCode};
	var payerAccNoList = [];
	var payerBkNmList =[];
	$.ajax({
		type: 'get',
		dataType: 'json',
		data: params,
		url: url,
		success: function (msg) {
			if (msg.success === 1 && CollectionUtils.isNotEmpty(msg.data)) {
				if (_loanInsCode === 'pafsbank'){
					$("#payerAccNoDiv").show();
					if (liger.get("payerBkNm")){
						liger.get("payerBkNm").setDisabled(true);
					}
				}
				var data = msg.data;
				for (var i = 0; i < data.length; i++) {
					var obj = new Object();
					obj.key = data[i].accNum;
					obj.value = data[i].accNum;
					payerAccNoList.push(obj);
					var obj1 = new Object();
					obj1.key = data[i].banAccNm;
					obj1.value = data[i].banAccNm;
					payerBkNmList.push(obj1);
					payerBkNmMap.put(data[i].accNum,data[i].banAccNm);
				}
				var payerAccNo = liger.get("payerAccNo");
				payerAccNo.setData(payerAccNoList);
				var payerBkNm = liger.get("payerBkNm");
				payerBkNm.setData(payerBkNmList);
			}
		}
	});
}
    $(function () {

        initAudRemainPro(); //初始化"信审遗留问题字段"-JL

    	if(EmergencyContact == "1"){
    		addtoAddEmergencyContact();//编辑
    	}else{
    		LooktoAddEmergencyContact();//插看
    		$("#addBtn").hide();
    		$("#addLinkManBtn").hide();
    		$("#delBtn").hide();
    		
    	}

        var prdAmt = parseInt('${capPayInfoVO.prdAmt}');//设备款
        $("#prdAmt").text(FormatMoney(prdAmt / 100));
        var initamt = parseInt('${capPayInfoVO.initPayAmt}');//首期款
        $("#initPayAmt").text(FormatMoney(initamt / 100));

        var minusamt = parseInt('${capPayInfoVO.minusAmt}');//首期款不含咨询费
        $("#initFstShowAmt").text(FormatMoney((initamt-minusamt)/100));

        $('#isFstCol').ligerCheckBox();
        
        <c:if test="${not empty accSize}">
        counts = ${accSize};
        </c:if>
        for (var i = 0; i < counts.length; i++) {
            $('#payeeTypCd' + counts[i]).ligerComboBox({
                valueField: 'key',
                textField: 'value'
            });
            $('#bkAccTypCd' + counts[i]).ligerComboBox({
                valueField: 'key',
                textField: 'value'
            });
            $("#payWayCd" + counts[i]).ligerComboBox({
                valueField: 'key',
                textField: 'value'
            });
        }

        $("#capPayInfo_form").ligerForm({
            validate: true
        });
        var form = liger.get("capPayInfo_form");
        form.setData({
        	isGrp:'${capPayInfoVO.isGrp}',
        	isOtherNoPass:'${capPayInfoVO.isOtherNoPass}',
        });
        var hjzxFlag = '${hjzxFlag}';//呼叫中心
        if(hjzxFlag==1){
        	liger.get("isGrp").setEnabled();
        }else{
        	liger.get("isGrp").setDisabled();
        }
        var mdfCntTypCd = '${mdfCntTypCd}';
        if(mdfCntTypCd==1){
        	liger.get("cntTypCd").setEnabled();
        }else{
        	liger.get("cntTypCd").setDisabled();
        }
        var mdfIsOtherNoPass = '${mdfIsOtherNoPass}';
        if(mdfIsOtherNoPass==1){
        	liger.get("isOtherNoPass").setEnabled();
        }else{
        	liger.get("isOtherNoPass").setDisabled();
        }
        var kjshFlag = '${kjshFlag}';//会计审核
        var confirmPay = '${confirmPay}';//付款审核
        if(kjshFlag==1 || confirmPay==1){
        	$("#isFstCol").removeAttr("disabled");
        }
        var zjlFlag = '${zjlFlag}';//呈报人
        if(zjlFlag==1){
        	$("#isFstCol").removeAttr("disabled");   
        }else{
        	$("#payRem").setDisabled_ligerTextarea(true);
        }
        var zjbFlag = '${zjbFlag}';//资金部
        var cnFlag = '${cnFlag}';//出纳
        //城配流程-财务付款 标识  - 维护付款方式/实付时间/实付金额  如果是网银付款 显示调资金系统发送付款信息按钮
        var isCPCW = '${isCPCW}';
        if(isCPCW==1){
        	$("#isFstCol").removeAttr("disabled");//可以修改是否首期款代收
        }
        var addReturnInfo = '${addReturnInfo}';
        for (var j = 0; j < counts.length; j++) {
            liger.get("payWayCd" + counts[j]).setDisabled();
            liger.get("actPayTms" + counts[j]).setDisabled();
        }
        var prjTypCd = "${capPayInfoVO.prjTypCd}";
        for (var j = 0; j < counts.length; j++) {
            liger.get("payeeTypCd" + counts[j]).setData(payeeTypCdList);
            liger.get("bkAccTypCd" + counts[j]).setData(bkAccTypCdList);
            liger.get("payWayCd" + counts[j]).setData(payWayCdList);
            
            if(zjlFlag==1){
                liger.get("payeeTypCd" + counts[j]).setEnabled();
                liger.get("rcptUnt" + counts[j]).setEnabled();
                liger.get("bkAccTypCd" + counts[j]).setEnabled();
                liger.get("payeeBkNm" + counts[j]).setEnabled();
                liger.get("payeeBkNo" + counts[j]).setEnabled();
                liger.get("accNo" + counts[j]).setEnabled();
				if(counts[j] == 11){
					liger.get("payeeTypCd" + counts[j]).setDisabled(true);
				}
            }else{
                liger.get("payeeTypCd" + counts[j]).setDisabled();
                liger.get("rcptUnt" + counts[j]).setDisabled();
                liger.get("bkAccTypCd" + counts[j]).setDisabled();
                liger.get("payeeBkNm" + counts[j]).setDisabled();
                liger.get("payeeBkNo" + counts[j]).setDisabled();
                liger.get("accNo" + counts[j]).setDisabled();
            }
            
            if(kjshFlag==1 || confirmPay==1){
            	liger.get("payAmt" + counts[j]).setEnabled();
            }
            if (updInsLoan == '1') {
				liger.get("actPayAmt" + counts[j]).setEnabled();
				liger.get("actPayTms" + counts[j]).setEnabled();
            	if (document.getElementById("loanInsCode").value == 'pafsbank'){
					liger.get("actPayAmt" + counts[j]).setDisabled(true);
					liger.get("actPayTms" + counts[j]).setDisabled(true);
				}
			}
            var isSended = $("#isSended" + counts[j]).val();
            if(zjbFlag==1 && isSended!=1){
            	liger.get("payWayCd" + counts[j]).setEnabled();
            }
            var payWayCd = liger.get("payWayCd" + counts[j]).getValue();
            if(cnFlag==1 && payWayCd != 3){//出纳节点并且付款方式不为网银
            	liger.get("actPayAmt" + counts[j]).setEnabled();
            	liger.get("actPayTms" + counts[j]).setEnabled();
            }
            if(isCPCW==1){
            	if(isSended!=1){
	            	liger.get("payWayCd" + counts[j]).setEnabled();
            	}
            	if(payWayCd==3){
    	        	//$("#savePayeeInfo_Btn").hide();
    	        	//$("#sendPayDIV").show();
	            	liger.get("actPayAmt" + counts[j]).setDisabled();
	            	liger.get("actPayTms" + counts[j]).setDisabled();
    	        }else{
    	        	//$("#savePayeeInfo_Btn").show();
    	        	//$("#sendPayDIV").hide();
	            	liger.get("actPayAmt" + counts[j]).setEnabled();
	            	liger.get("actPayTms" + counts[j]).setEnabled();
    	        }
            	//绑定付款方式change事件
    	        $("#payWayCd" + counts[j]).change(function (jj) {
    	        	var payWayCdArr = "";
    	        	for (var k = 0; k < counts.length; k++) {
    	        		var payWayCd_0 = liger.get("payWayCd" + counts[k]).getValue();
    	        		payWayCdArr+=payWayCd_0;
    	        	}
    	            if(payWayCdArr.indexOf("3")>-1){
    	            	$("#savePayeeInfo_Btn").hide();
    	            	$("#sendPayDIV").show();
    	            }else{
    	            	$("#savePayeeInfo_Btn").show();
    	            	$("#sendPayDIV").hide();
    	            }
    	            var thisid = $(this)[0].attributes.id.nodeValue;
    	            var purpCd = thisid.substr(thisid.length-1,1)
    	            var payWayCd_this = liger.get("payWayCd" + purpCd).getValue();
    	            if(payWayCd_this==3){
    	            	liger.get("actPayAmt" + purpCd).setDisabled();
    	            	liger.get("actPayTms" + purpCd).setDisabled();
    	            }else{
    	            	liger.get("actPayAmt" + purpCd).setEnabled();
    	            	liger.get("actPayTms" + purpCd).setEnabled();
    	            }
    	        });
            }
            
            if(addReturnInfo==1){
            	liger.get("actPayAmt" + counts[j]).setEnabled();
 	            liger.get("actPayTms" + counts[j]).setEnabled();
            }
            
            if(zjlFlag==1){
	            (function (j) {
	                $("#payeeTypCd" + counts[j]).change(function () {
	                    var payeeTypCd = liger.get("payeeTypCd" + counts[j]).getValue();
	                    /* if (StringUtils.isNotEmpty(prjTypCd) && prjTypCd == "CPYW") {
	                        return;
	                    } */
	                    $("#rcptUnt" + counts[j]).val("");
	                    $("#bkAccTypCd" + counts[j]).val("");
	                    $("#payeeBkNm" + counts[j]).val("");
	                    $("#payeeBkNo" + counts[j]).val("");
	                    $("#accNo" + counts[j]).val("");
	                    if (payeeTypCd == 3) {
	                        liger.get("bkAccTypCd" + counts[j]).setEnabled();
	                        liger.get("payeeBkNm" + counts[j]).setEnabled();
	                        liger.get("payeeBkNo" + counts[j]).setEnabled();
	                        liger.get("accNo" + counts[j]).setEnabled();
	                    } else {
	                        liger.get("bkAccTypCd" + counts[j]).setDisabled(true);
	                        liger.get("payeeBkNm" + counts[j]).setDisabled(true);
	                        liger.get("payeeBkNo" + counts[j]).setDisabled(true);
	                        liger.get("accNo" + counts[j]).setDisabled(true);
	                    }
	
	                });
	
	                //选择
	                $("#rcptUnt" + counts[j]).click(function (event) {
	                    var payeeTypCd = liger.get("payeeTypCd" + counts[j]).getValue();
	                    if (!payeeTypCd) {
	                        $.ligerDialog.SQalert({content: "请先选择收款方类型", SQ_type: "warning"});
	                        return;
	                    }
	                    if (payeeTypCd == 3) {
	                        return;
	                    }
	                    /* if (StringUtils.isNotEmpty(prjTypCd) && prjTypCd == "CPYW") {
	                        return;
	                    } */
	                    //var cstId = $("#cstId").val();//客户ID
	                    //var splId = $("#splId").val();//供应商ID
	                    var onOk = function (item, Dialog) {
	                        //在子页面里绑定 frameElement.dialog.onOk = function () {}
	                        if (Dialog.onOk) Dialog.onOk();
	                    };
	                    var onCancel = function (item, Dialog) {
	                        //在子页面里绑定 frameElement.dialog.onCancel = function () {}
	                        if (Dialog.onCancel) Dialog.onCancel();
	                    };
	                    $.ligerDialog.SQopen({
	                        width: 850,
	                        height: 350,
	                        title: '收款账户列表',
	                        url: '<%=path%>/capital/capPayeeInfo/toChoosePayee.do',
	                        buttons: [
	                            {
	                                text: "确定", onclick: onOk, type: 'ok', cls: 'l-dialog-btn-ok'
	                            }, {
	                                text: "关闭", onclick: onCancel, type: 'cancel', cls: 'l-dialog-btn-no'
	                            }
	                        ],
	                        data: {payeeTypCd: payeeTypCd, cstId: '${capPayInfoVO.cstId}', splId: '${capPayInfoVO.splId}', purpCd: counts[j],
								paySchId :"${capPayInfoVO.paySchId}",prjPrdDtlId:"${capPayInfoVO.prjPrdDtlId}",orgCd:"${capPayInfoVO.cstMgrOrgCd}"}
	                    });
	                });
	            })(j);
            }
        }
        if(isCPCW==1){
        	var payWayCdArr = "";
        	var isSendedArr = "";
        	for (var k = 0; k < counts.length; k++) {
        		var payWayCd_0 = liger.get("payWayCd" + counts[k]).getValue();
	            var isSended_0 = $("#isSended" + counts[k]).val();
        		payWayCdArr+=payWayCd_0;
        		isSendedArr+=isSended_0;
        	}
            if(payWayCdArr.indexOf("3")>-1 && isSendedArr.indexOf("0")>-1){
            	$("#savePayeeInfo_Btn").hide();
            	$("#sendPayDIV").show();
            }else{
            	$("#savePayeeInfo_Btn").show();
            	$("#sendPayDIV").hide();
            }
	        for (var j = 0; j < counts.length; j++) {
	            var payWayCd_this = liger.get("payWayCd" + counts[j]).getValue();
	            if(payWayCd_this==3){
	            	liger.get("actPayAmt" + counts[j]).setDisabled();
	            	liger.get("actPayTms" + counts[j]).setDisabled();
	            }else{
	            	liger.get("actPayAmt" + counts[j]).setEnabled();
	            	liger.get("actPayTms" + counts[j]).setEnabled();
	            }
	        }
        }
        
        var addReturnInfo_rebate = '${addReturnInfo_rebate}';
        if(addReturnInfo_rebate==1){
	        if(liger.get("actPayAmt2")){
	        	liger.get("actPayAmt2").setEnabled();
	        }
	        if(liger.get("actPayTms2")){
	        	liger.get("actPayTms2").setEnabled();
	        }
        }
        var modifyRebateBank = '${modifyRebateBank}';
        if(modifyRebateBank==1){
        	liger.get("payeeTypCd2").setEnabled();
            liger.get("rcptUnt2").setEnabled();
            liger.get("bkAccTypCd2").setEnabled();
            liger.get("payeeBkNm2").setEnabled();
            liger.get("payeeBkNo2").setEnabled();
            liger.get("accNo2").setEnabled();
        	$("#payeeTypCd2").change(function () {
                var payeeTypCd = liger.get("payeeTypCd2").getValue();
                /* if (StringUtils.isNotEmpty(prjTypCd) && prjTypCd == "CPYW") {
                    return;
                } */
                $("#rcptUnt2").val("");
                $("#bkAccTypCd2").val("");
                $("#payeeBkNm2").val("");
                $("#payeeBkNo2").val("");
                $("#accNo2").val("");
                if (payeeTypCd == 3) {
                    liger.get("bkAccTypCd2").setEnabled();
                    liger.get("payeeBkNm2").setEnabled();
                    liger.get("payeeBkNo2").setEnabled();
                    liger.get("accNo2").setEnabled();
                } else {
                    liger.get("bkAccTypCd2").setDisabled(true);
                    liger.get("payeeBkNm2").setDisabled(true);
                    liger.get("payeeBkNo2").setDisabled(true);
                    liger.get("accNo2").setDisabled(true);
                }

            });

            //选择
            $("#rcptUnt2").click(function (event) {
                var payeeTypCd = liger.get("payeeTypCd2").getValue();
                if (!payeeTypCd) {
                    $.ligerDialog.SQalert({content: "请先选择收款方类型", SQ_type: "warning"});
                    return;
                }
                if (payeeTypCd == 3) {
                    return;
                }
                /* if (StringUtils.isNotEmpty(prjTypCd) && prjTypCd == "CPYW") {
                    return;
                } */
                //var cstId = $("#cstId").val();//客户ID
                //var splId = $("#splId").val();//供应商ID
                var onOk = function (item, Dialog) {
                    //在子页面里绑定 frameElement.dialog.onOk = function () {}
                    if (Dialog.onOk) Dialog.onOk();
                };
                var onCancel = function (item, Dialog) {
                    //在子页面里绑定 frameElement.dialog.onCancel = function () {}
                    if (Dialog.onCancel) Dialog.onCancel();
                };
                $.ligerDialog.SQopen({
                    width: 850,
                    height: 350,
                    title: '收款账户列表',
                    url: '<%=path%>/capital/capPayeeInfo/toChoosePayee.do',
                    buttons: [
                        {
                            text: "确定", onclick: onOk, type: 'ok', cls: 'l-dialog-btn-ok'
                        }, {
                            text: "关闭", onclick: onCancel, type: 'cancel', cls: 'l-dialog-btn-no'
                        }
                    ],
                    data: {payeeTypCd: payeeTypCd, cstId: '${capPayInfoVO.cstId}', splId: '${capPayInfoVO.splId}', purpCd: 2}
                });
            });
        }
        
        var pamt = parseInt('${capPayInfoVO.prdAmt}');//设备款
        var initamt = parseInt('${capPayInfoVO.initPayAmt}');//首期款
        var minusamt = parseInt('${capPayInfoVO.minusAmt}');//首期款不含咨询费
        
        /*是否代收首期款*/
        $("#isFstCol").change(function () {
            if (this.checked) {
                $("#payAmt1").val(parseInt(pamt - initamt)/100);
            } else {
                $("#payAmt1").val(parseInt(pamt)/100);
            }
        });
        
        
        pageInTab = $("#pageInTab").ligerTab({
            height: 'auto',
            contextmenu: false,
            minIframeHeight: GET_minIframeHeight(),
            onAfterSelectTabItem: function (tabid) {
                if (loadedTabs.indexOf(tabid) < 0) {
                    loadedTabs.push(tabid);
                    if (tabid != "payTab") {
                        switch (tabid) {
                            case "leaseTab":
                            	//pageInTab.setTabItemSrc(tabid, "<%=path%>/capital/capPayInfo/toLeaseListPage.do?paySchId=${capPayInfoVO.paySchId}");
                            	var prjTypCd='${capPayInfoVO.prjTypCd}';
                            	if(prjTypCd=="CDDYW"){
	                                pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjprdvehinfo/toCompPrdInfoListPage.do?dtlId=${capPayInfoVO.prjPrdDtlId}&isAuditNode=0");
                            	}else{
	                                pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjprdvehinfo/toCompPrdInfoListPage.do?dtlId=${capPayInfoVO.prjPrdDtlId}&isAuditNode="+_isAuditNode);
                            	}
                                break;
                            case "hisTab":
                                pageInTab.setTabItemSrc(tabid, "<%=path%>/capital/capPayInfo/toHisPayListPage.do?id=${capPayInfoVO.id}&paySchId=${capPayInfoVO.paySchId}");
                                break;
                            case "mateTab":
                                pageInTab.setTabItemSrc(tabid, "<%=path%>/capital/capPayInfo/toMateListPage.do?ctrlKey=${ctrlKey}&id=${capPayInfoVO.id}&payStsCd=${capPayInfoVO.payStsCd}&prjPrdDtlId=${capPayInfoVO.prjPrdDtlId}&cstId=${capPayInfoVO.cstId}&prjId=${capPayInfoVO.prjId}&cstMgrOrgCd=${capPayInfoVO.cstMgrOrgCd}&prjTypCd=${capPayInfoVO.prjTypCd}&paySchNo=${capPayInfoVO.paySchNo}");
                                break;
                            case "insTab":
                            	var mdfInsPlc = '${mdfInsPlc}';
                            	var operateInsPlc = '${operateInsPlc}';
                            	if(_isAuditNode==1 || mdfInsPlc==1 || operateInsPlc==1){
	                                pageInTab.setTabItemSrc(tabid, "<%=path%>/insurance/insPlcBscInfo/toPlcPage.do?paySchId=${capPayInfoVO.paySchId}&operateInsPlc=${operateInsPlc}");
   			                   	}else{
                                	pageInTab.setTabItemSrc(tabid, "<%=path%>/insurance/insPlcBscInfo/toPlcListPage.do?paySchId=${capPayInfoVO.paySchId}");
   			                   	}
                                break;
                            case "insTabA":
                                pageInTab.setTabItemSrc(tabid, "<%=path%>/inscare/insapplication/toInsApplicationStagingPage.do?prjId=${capPayInfoVO.prjId}&paySchNo=${capPayInfoVO.paySchNo}");
                                break;
                            case "certTab":
                                pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjprdvehinfo/toPrjPrdVehInfoListInFlow.do?isGpsNode=${isGpsNode}&paySchNo=${capPayInfoVO.paySchNo}&isAuditNode="+_isAuditNode + "&noLinkAction=${noLinkAction}");
                                break;
                            case "invoiceTab":
                                pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjPrdInvoice/toflowListPage.do?paySchNo=${capPayInfoVO.paySchNo}");
                                break;
                            case "startRentTab":
                            	pageInTab.setTabItemSrc(tabid, "<%=path%>/risk/rskCommRec/toStartRentPage.do?cstId=${capPayInfoVO.cstId}&paySchId=${capPayInfoVO.paySchId}");
                                break;
							case "loanTab":
								pageInTab.setTabItemSrc(tabid, "<%=path%>/capPay/flow/toLoanResultPage.do?prjId=${capPayInfoVO.prjId}");
								break;
							case "AccTab":
								pageInTab.setTabItemSrc(tabid, "<%=path%>/capPay/flow/toAccInsCfgPage.do?prjId=${capPayInfoVO.prjId}&&isShowSaveBtn=" + "0");
								break;
                        }
                    }
                }
                SetIframe_height();
            }
        });

        $.extend(true, pageInApp, {
            pageInTab: pageInTab
        });

        $("#pageloading").hide();


		var payerBkNmMap = new HashMap();
		liger.get("isOutInsLoan").setDisabled(true);
		$("#payerAccNoDiv").hide();
		var _loanInsCode = $('#loanInsCode').val();
		if (null != _loanInsCode && "" != _loanInsCode) {
			setPayerAccNoData(_loanInsCode,payerBkNmMap);
		} else {
			if (liger.get("payerAccNo")){
				liger.get("payerAccNo").setValue(null);
			}
			if (liger.get("payerBkNm")){
				liger.get("payerBkNm").setValue(null);
			}
		}
		if (_loanInsCode === 'pafsbank'){
			$("#insLoanTmDiv").hide();
			$("#insLoanSumDiv").hide();
			$("#payerAccNoDiv").show();
			if (liger.get("payerAccNo")){
				liger.get("payerAccNo").setDisabled(true);
			}
			if (liger.get("payerBkNm")){
				liger.get("payerBkNm").setDisabled(true);
			}
		}
		if (updInsLoan === '2'){
			liger.get("loanInsCode").setEnabled();
		} else if (updInsLoan === '1'){
			liger.get("loanInsCode").setDisabled(true);
			if (_loanInsCode === 'pafsbank'){
				if (liger.get("payerAccNo")){
					liger.get("payerAccNo").setEnabled();
				}
			}
		} else {
			liger.get("loanInsCode").setDisabled(true);
			if (liger.get("insLoanTm")){
				liger.get("insLoanTm").setDisabled(true);
			}
			if (liger.get("insLoanSum")){
				liger.get("insLoanSum").setDisabled(true);
			}
		}

		$("#loanInsCode").change(function (){
			var _loanInsCode = $(this).val();
			var friBaseMap = '${friBaseMap}';
			if (_loanInsCode === 'pafsbank') {
				$("#insLoanTmDiv").hide();
				$("#insLoanSumDiv").hide();
				$("#payerAccNoDiv").show();
				if (liger.get("payerBkNm")){
					liger.get("payerBkNm").setDisabled(true);
				}
				if (liger.get("payerAccNo")){
					liger.get("payerAccNo").setDisabled(true);
				}
				for (var j = 0; j < counts.length; j++) {
					var selectid= $("#payWayCd" + counts[j]).ligerGetComboBoxManager();
					$("#payWayCd" + counts[j]).val("3");
					selectid.setValue("3");
					selectid.setText("外付网银");
					liger.get("payWayCd" + counts[j]).setDisabled(true);
				}
			} else {
				$("#insLoanTmDiv").show();
				$("#insLoanSumDiv").show();
				for (var j = 0; j < counts.length; j++) {
					var selectid= $("#payWayCd" + counts[j]).ligerGetComboBoxManager();
					$("#payWayCd" + counts[j]).val("7");
					selectid.setValue("7");
					selectid.setText("其他");
					liger.get("payWayCd" + counts[j]).setDisabled(true);
				}
			}
			if(friBaseMap.length>0){
				friBaseMap = JSON.parse(friBaseMap);
				for(var key in friBaseMap) {
					if(key === _loanInsCode){
						var selectid= $("#isOutInsLoan").ligerGetComboBoxManager();
						$("#isOutInsLoan").val(friBaseMap[key]);
						selectid.setValue(friBaseMap[key]);
					}
				}
			}
		});

		$("#payerAccNo").change(function (){
			var _payerAccNo = $(this).val();
			if(payerBkNmMap.size()>0){
				if (payerBkNmMap.containsKey(_payerAccNo)){
					var selectid= $("#payerBkNm").ligerGetComboBoxManager();
					$("#payerBkNm").val(payerBkNmMap.get(_payerAccNo));
					selectid.setValue(payerBkNmMap.get(_payerAccNo));
					selectid.setText(payerBkNmMap.get(_payerAccNo));
				}
			}
		});

        $("#payeeTypCd").change(function () {
            var payeeTypCd = liger.get("payeeTypCd").getValue();
            $("#rcptUnt").val("");
            $("#bkAccTypCd").val("");
            $("#payeeBkNm").val("");
            $("#payeeBkNo").val("");
            $("#accNo").val("");
            if(payeeTypCd==3){
                $("#bkAccTypCd").removeAttr("readonly");
                $("#payeeBkNm").removeAttr("readonly");
                $("#payeeBkNo").removeAttr("readonly");
                $("#accNo").removeAttr("readonly");
            }else{
                $("#bkAccTypCd").attr("readonly","readonly");
                $("#payeeBkNm").attr("readonly","readonly");
                $("#payeeBkNo").attr("readonly","readonly");
                $("#accNo").attr("readonly","readonly");
            }
        });

        //选择
        $("#rcptUnt").click(function (event) {
            var payeeTypCd = liger.get("payeeTypCd").getValue();
            if (!payeeTypCd) {
                $.ligerDialog.SQalert({content: "请先选择收款方类型", SQ_type: "warning"});
                return;
            }
            if(payeeTypCd==3){
                return;
            }
            //var cstId = $("#cstId").val();//客户ID
            //var splId = $("#splId").val();//供应商ID
            var onOk = function (item, Dialog) {
                if (Dialog.onOk) Dialog.onOk();
            };
            var onCancel = function (item, Dialog) {
                if (Dialog.onCancel) Dialog.onCancel();
            };
            $.ligerDialog.SQopen({
                width: 850,
                height: 350,
                title: '收款账户列表',
                url:'<%=path%>/capital/capPayeeInfo/toChoosePayee.do',
                buttons: [
                    {
                        text: "确定", onclick: onOk, type: 'ok', cls: 'l-dialog-btn-ok'
                    }, {
                        text: "关闭", onclick: onCancel, type: 'cancel', cls: 'l-dialog-btn-no'
                    }
                ],
                data:{payeeTypCd:payeeTypCd,cstId:'${capPayInfoVO.cstId}',splId:'${capPayInfoVO.splId}'}
            });
        });
		if (null != isAdvBiz && 1 == isAdvBiz) {
			$("span.sq-button").hide();
		}
        SET_popupIframeHeight();
    });
//初始化担保人列表
function initGuarantorList(){
	if(!prjId)return;
	guarantorGrid = $("#ligergrid_guarantor").ligerGrid({
        url: '<%=path%>/project/prjcstbscInfo/initGuarantorList.do',
        method: 'get',
        parms:{
        	prjId:prjId,
        	cstRlTyp:ProjectConstant.CST_RL_SPONSOR
        },
        columns: [
            {display: '担保人姓名', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h ='';
            		if(rowdata.cstTypCd==1){
                    	h+='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
                    	h+="'"+"reCstNm"+"','"+rowdata.cstNm+"')";
                    	h+='"><i class="sqBtnIco_1"></i></a>';
                    	h+='&nbsp;&nbsp;&nbsp;&nbsp;';
                    }
                    if(rowdata.cstTypCd==2){
                    	h+='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
                    	h+="'"+"reCstNm"+"','"+rowdata.cstNm+"')";
                    	h+='"><i class="sqBtnIco_1"></i></a>';
                    	h+='&nbsp;&nbsp;&nbsp;&nbsp;';
                    }
            		h+='<a href="javascript:toGuarantorDetail(';
                    h+=rowdata.id;
                    h+=","+rowdata.cstTypCd;
                    h+=')">'+rowdata.cstNm+'</a>';
                return h;
            	}
            },
            {display: '担保人身份证号', name: '', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.certNo)){
						h='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
						h+="'"+"reCertNo"+"','"+rowdata.certNo+"')";
						h+='"><i class="sqBtnIco_1"></i></a>';
						h+='&nbsp;&nbsp;&nbsp;&nbsp;';
						h+=rowdata.certNo;
            		}
            		return h;
            	}
            },
            {display: '联系方式', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h = '';
            		if(rowdata.cstNpBscInfoVO){
            			var cstNpBscInfoVO = rowdata.cstNpBscInfoVO;
            			if(cstNpBscInfoVO && StringUtils.isNotEmpty(cstNpBscInfoVO.mp1)){
            				h = '' + cstNpBscInfoVO.mp1 + '';
            			}else if(cstNpBscInfoVO && StringUtils.isNotEmpty(cstNpBscInfoVO.mp2)){
            				h = '' + cstNpBscInfoVO.mp2 + '';
            			}
            		}else if(rowdata.cstCorpBscInfoVO){
            			var cstCorpBscInfoVO = rowdata.cstCorpBscInfoVO;
            			if(cstCorpBscInfoVO && StringUtils.isNotEmpty(cstCorpBscInfoVO.officeTel)){
            				h = '' + cstCorpBscInfoVO.officeTel + '';
            			}
            		}
            		if(StringUtils.isNotEmpty(h)){
            			var h1='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
            			h1+="'"+"reMp1"+"','"+h+"')";
                    	h1+='"><i class="sqBtnIco_1"></i></a>';
                    	h1+='&nbsp;&nbsp;&nbsp;&nbsp;'+h;
                    	return h1;
            		}
                	return h;
            	}
            },
            {display: '联系地址', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h = '';
            		if(rowdata.cstNpBscInfoVO){
            			var cstNpBscInfoVO = rowdata.cstNpBscInfoVO;
            			if(cstNpBscInfoVO && StringUtils.isNotEmpty(cstNpBscInfoVO.homeAddr)){
            				h = '' + cstNpBscInfoVO.homeAddr + '';
            			}
            		}else if(rowdata.cstCorpBscInfoVO){
            			var cstCorpBscInfoVO = rowdata.cstCorpBscInfoVO;
            			if(cstCorpBscInfoVO && StringUtils.isNotEmpty(cstCorpBscInfoVO.officeAddr)){
            				h = '' + cstCorpBscInfoVO.officeAddr + '';
            			}
            		}
            		if(StringUtils.isNotEmpty(h)){
            			var h1='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
            			h1+="'"+"rePostAddr"+"','"+h+"')";
                    	h1+='"><i class="sqBtnIco_1"></i></a>';
                    	h1+='&nbsp;&nbsp;&nbsp;&nbsp;'+h;
                    	return h1;
            		}
                	return h;
            	}
            },
            {display: '担保人婚姻状况', name: '', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO) && StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO.marStsCdNm)){
            			h = ''+rowdata.cstNpBscInfoVO.marStsCdNm+'';
            		}
            		return h;
            	}
            },
            {display: '担保人配偶姓名', name: '', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO) && StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO.cstNpSocialRlVO)){
            			h = ''+rowdata.cstNpBscInfoVO.cstNpSocialRlVO.rlNm+'';
            		}
            		if(StringUtils.isNotEmpty(h)){
            			var h1='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
            			h1+="'"+"reCstNm"+"','"+h+"')";
                    	h1+='"><i class="sqBtnIco_1"></i></a>';
                    	h1+='&nbsp;&nbsp;&nbsp;&nbsp;'+h;
                    	return h1;
            		}
            		return h;
            	},
           	},
			{display: '合同签署状态', name: '', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.prjCstBscInfoVO.conSignStsNm)){
            			h = ''+rowdata.prjCstBscInfoVO.conSignStsNm+'';
            		}
            		return h;
            	}
            },
			{display: '担保属性', name: '', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.prjCstBscInfoVO.guaraTypCdNm)){
            			h = ''+rowdata.prjCstBscInfoVO.guaraTypCdNm+'';
            		}
            		return h;
            	}
            },
            {display: '签署方式', name: '', minWidth: 80,
            	render: function (rowdata, rowindex, value){
            		var h='';
            		if(StringUtils.isNotEmpty(rowdata.prjCstBscInfoVO.cntTypCdNm) ){
            			h = ''+rowdata.prjCstBscInfoVO.cntTypCdNm+'';
            		}
            		return h;
            	}
            },
			getNpGuarColumn()
            ],
        onBeforeEdit: function (e) {},
        onBeforeShowData: function(){SetIframe_height();},
        onAfterShowData: function(){SetIframe_height();},
        pageSize:100,
        usePagerOnLessPagesize: false,
        root: 'rows',
        record: 'total',
        hideLoadButton: true,
        width: '100%',
        height: 300,
        heightDiff: -2,
        enabledEdit: true,
        isScroll: false,
        checkbox: false,
        rownumbers: true,
        allowUnSelectRow: true,
        alternatingRow: false
    });
}
//获取操作列
function getNpGuarColumn(){
	var column = {
		display: '操作',
		isSort: false,
		width: 250,
		align:'left',
		render: function (rowdata, rowindex, value){
			var h="";
			if(rowdata.id && rowdata.cstNpBscInfoVO){
                if((guaraStatus==3) && (StringUtils.isEmpty(rowdata.prjCstBscInfoVO.conSignSts) || rowdata.prjCstBscInfoVO.conSignSts==0)){
                    h+='<a class="sq-button-hasicon" href="javascript:removeBtn(';
                    h+="'"+rowdata.prjCstBscInfoVO.id+"',";
                    h+= "'"+rowdata.prjCstBscInfoVO.isPushCon + "',";
                    h+= "'"+rowdata.prjCstBscInfoVO.guaraTypCd + "'";
                    h+=')"><i class="sqBtnIco_7"></i>删除</a>'
                }
                if((guaraStatus==3 || guaraStatus==2) && (StringUtils.isEmpty(rowdata.prjCstBscInfoVO.conSignSts) || rowdata.prjCstBscInfoVO.conSignSts==0)){
                    h+='<a class="sq-button-hasicon" href="javascript:modifyNpGuarBtn(';
                    h+="'"+rowdata.prjCstBscInfoVO.id+"',";
                    h+= "'"+rowdata.prjCstBscInfoVO.isPushCon + "',";
                    h+="'"+rowdata.cstNpBscInfoVO.mp1+"',";
                    h+=')"><i class="sqBtnIco_4"></i>修改</a>'
                }
                h+='<a class="sq-button-hasicon" href="javascript:detailNpGuarBtn(';
                h+="'"+rowdata.prjCstBscInfoVO.id+"',";
                h+="'"+rowdata.cstNpBscInfoVO.mp1+"',";
                h+=')"><i class="sqBtnIco_2"></i>查看</a>'
                if (rowdata.prjCstBscInfoVO.cntTypCd==1 && (StringUtils.isEmpty(rowdata.prjCstBscInfoVO.conSignSts) || rowdata.prjCstBscInfoVO.conSignSts==0) && rowdata.prjCstBscInfoVO.isPushCon==0) {
                    h+='<a class="sq-button-hasicon" href="javascript:pushCon(';
                    h+="'"+rowdata.prjCstBscInfoVO.id+"',";
                    h+="'"+rowdata.prjCstBscInfoVO.guaraTypCd+"'";
                    h+=')"><i class="sqBtnIco_3"></i>推送合同</a>'
                }
            }
		 	return h;
		}
	}
	return column;
}
//查看担保人信息
function detailNpGuarBtn(id,mp1){
		var  url = '<%=path%>/project/prjcstbscInfo/detailNpGuarPage.do?id='+id+'&&mp1='+mp1+'&&showGuarPart='+'1';//showGuarPart=1不展示部分担保人信息
		$.ligerDialog.SQopen({
            height:300,
            width: 600,
            title : '查看担保人信息',
            url: url,
            showMax: false,
            showToggle: true,
            showMin: false,
            isResize: true,
            slide: false,
        });
	}
//修改担保人信息
function modifyNpGuarBtn(id,isPushCon,mp1){
	var  url = '<%=path%>/project/prjcstbscInfo/modifyNpGuarPage.do?id='+id+'&&mp1='+mp1+'&&showGuarPart='+'1'+'&&prjId='+prjId +'&&isPushCon='+isPushCon+'&&onlyConTyp='+'1';
	$.ligerDialog.SQopen({
		height:300,
		width: 600,
		title : '修改担保人信息',
		url: url,
		showMax: false,
		showToggle: true,
		showMin: false,
		isResize: true,
		slide: false,
	});
}
//推送担保合同
function pushCon(id,guaraTypCd){
    if (!id){
        return;
    }
    var params = {};
    params.id = id;
    params.guaraTypCd = guaraTypCd;
    $.ajax({
        type: 'post',
        dataType:'json',
        data:params,
        url: '<%=path%>/project/prjcstbscInfo/pushCon.do',
        success:function(msg){
             if(msg.success == 1){
                 if(cstTypCd=ProjectConstant.CST_TYP_CD_NP){
                     liger.get("ligergrid_guarantor").reload();
                    };
             }else{
                 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
             }
        }
    });
}
//删除所选项目客户信息
function removeBtn(id,isPushCon,guaraTypCd){
	$.ligerDialog.confirm(LogUtils.LOG_CMM_DELETE_CONFIRM, function (flag) {
	if(!id || id=="undefined"){
		var manager = $("#ligergrid_guarantor").ligerGetGridManager();
		manager.deleteSelectedRow();
		return;
	}
	if(flag == false)return;
    var params = {};
    params.guaraTypCd = guaraTypCd;
    params.prjId = prjId;
    params.isPushCon = isPushCon;
    params.id = id;
	$.ajax({
		type: 'post',
		dataType:'json',
		data:params,
		url: '<%=path%>/project/prjcstbscInfo/removeCstAndDelCont.do',
		success:function(msg){
			 if(msg.success == 1){
				 liger.get("ligergrid_guarantor").reload();
			 }else{
				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
			 }
		}
		});
	});
}
//担保人详情
function toGuarantorDetail(_cstId,_cstTypCd){
	if(!_cstId || !_cstTypCd)return;
	if(_cstTypCd == 1){
		Add_navTab('tab_customer_np_detail'+_cstId,'担保人详情','<%=path%>/customer/cstbscinfo/toCustCstBacInfoNpDetailPage.do?id='+_cstId);
	}else if(_cstTypCd == 2){
		Add_navTab('tab_customer_corp_detail'+_cstId,'担保人详情','<%=path%>/customer/cstbscinfo/toCustCstBacInfoCorpDetailPage.do?id='+_cstId);
	}
}
//查询项目信息(查重)
function toRePrjPageList(type,value){
	var _cstId = $("#cstId").val();
	var _cstTypCd = $("#cstTypCd").val();
	if(StringUtils.isEmpty(_cstId) || StringUtils.isEmpty(_projectId) || StringUtils.isEmpty(_cstTypCd))return;
	Add_navTab('tab_re_prj'+'-'+type+_cstId,'查重页面','<%=path%>/project/prjbscinfo/toRePrjListPage.do?id='+_cstId+'&cstTypCd='+_cstTypCd+'&prjId='+_projectId+'&type='+type+'&value='+value);
}
    //获取收款方
    function getRcptUntList(payeeTypCd, splId, cstId) {
        if (!payeeTypCd) {
            $.ligerDialog.SQalert({content: "请先选择收款方类型", SQ_type: "warning"});
            return;
        }
        var wait_dialog;
        $.ajax({
            type: 'get',
            dataType: 'json',
            async: false,
            url: '<%=path%>/capital/capPayeeInfo/getPayeeList.do?payeeTypCd=' + payeeTypCd + "&splId=" + splId + "&cstId=" + cstId,
            beforeSend: function () {
                wait_dialog = $.ligerDialog.SQalert({
                    content: LogUtils.LOG_CMM_DATA_LOADING,
                    SQ_type: "waitting"
                });
            },
            success: function (msg) {
                wait_dialog.close();
                if (msg.success == 1) {
                    rcptUntList = JSON.parse(msg.data);
                } else {
                    rcptUntList = [];
                }
            }
        });
    }

    function getBkDtl(bkId, payeeTypCd) {
        if (payeeTypCd == 1) {
            $.ligerDialog.open({
                cls: 'noBorder_Dialog',
                width: 1000,
                height: 400,
                title: '供应商银行账户信息',
                url: '<%=path%>/product/splBank/toDetail.do?id=' + bkId
            });
        } else {
            //TODO yjc 客户银行账号信息
            $.ligerDialog.open({
                cls: 'noBorder_Dialog',
                width: 550,
                height: 500,
                title: '承租人银行账户信息',
                //url:'<%=path%>/capital/capPayInfo/toModifyPage.do?id='+bkId
            });
        }
    }
    //保存是否团单
    function saveIsGrp_Btn(){
    	var _isGrp = $("#isGrp").val();
    	if(!_isGrp || _isGrp==" "){
    		var hjzxFlag = '${hjzxFlag}';//呼叫中心
   	        if(hjzxFlag==1){
	    		top.$.ligerDialog.SQalert({content: "是否团单不能为空.", SQ_type: "warning"});
	    		return;
   	        }
    	}
    	//除"商家必要资料"外是否有不合规信息
    	var _isOtherNoPass = $("#isOtherNoPass").val();
    	if(!_isOtherNoPass){
    		_isOtherNoPass = "";
    	}
    	var wait_dialog;
    	$.ajax({
    		type: 'post',
    		dataType:'json',
    		data:{
    			capPayId:_capPayId,
    			isGrp:_isGrp,
    			isOtherNoPass:_isOtherNoPass
    		},
    		url: '<%=path%>/capPay/flow/modifyIsGrp.do',
    		beforeSend: function(){
		          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		     },
    		success:function(msg){
    			 wait_dialog.close();
    			 if(msg.success == 1){
    				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
    			 }else{
    				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
    			 }
    		}
    	});
    }
    //保存三方业务处理意见
    function saveOrgBizOpnCd(){
    	var orgBizOpnCd = $("#orgBizOpnCd").val();
    	if(!orgBizOpnCd || orgBizOpnCd==" "){
    		top.$.ligerDialog.SQalert({content: "三方业务处理意见不能为空.", SQ_type: "warning"});
    		return;
    	}
    	var wait_dialog;
    	$.ajax({
    		type: 'post',
    		dataType:'json',
    		data:{
    			prjId:'${capPayInfoVO.prjId }',
    			orgBizOpnCd:orgBizOpnCd
    		},
    		url: '<%=path%>/capPay/flow/modifyOrgBizOpnCd.do',
    		beforeSend: function(){
		          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		     },
    		success:function(msg){
    			 wait_dialog.close();
    			 if(msg.success == 1){
    				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
    			 }else{
    				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
    			 }
    		}
    	});
    }
    //保存合同签署方式
    function saveCntTypCd(){
    	var _cntTypCd = $("#cntTypCd").val();
    	if(!_cntTypCd || _cntTypCd==" "){
    		top.$.ligerDialog.SQalert({content: "合同签署方式不能为空.", SQ_type: "warning"});
    		return;
    	}
    	var wait_dialog;
    	$.ajax({
    		type: 'post',
    		dataType:'json',
    		data:{
    			prjId:'${capPayInfoVO.prjId }',
    			cntTypCd:_cntTypCd
    		},
    		url: '<%=path%>/capPay/flow/modifyCntTypCd.do',
    		beforeSend: function(){
		          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		     },
    		success:function(msg){
    			 wait_dialog.close();
    			 if(msg.success == 1){
    				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
    			 }else{
    				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
    			 }
    		}
    	});
    }
    //保存会计核算付款金额
    function savePayAmt_Btn(){
    	var _payAmt = $("#payAmt").val();
    	if(!_payAmt || _payAmt==""){
    		$.ligerDialog.SQalert({content: "应付款金额不能为空.", SQ_type: "warning"});
    		return;
    	}
    	var data = new Object();
    	data["payAmt"]= _payAmt;
    	data["capPayId"]= _capPayId;
    	data["isFstCol"]= liger.get("isFstCol").getValue();
    	var wait_dialog;
    	$.ajax({
    		type: 'post',
    		dataType:'json',
    		data:data,
    		url: '<%=path%>/capPay/flow/modifyPayAmt.do',
    		beforeSend: function(){
		          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		     },
    		success:function(msg){
    			 wait_dialog.close();
    			 if(msg.success == 1){
    				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
    				 var isNeedCallback = '${isNeedCallback}';
                     if(isNeedCallback==1){
 	                  	//回调刷新列表
 						 var callback=GET_W2Wcallback();
 			             callback();
                     }
    			 }else{
    				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
    			 }
    		}
    	});
    }
    //保存收款方信息
	function savePayeeInfo_Btn(){
		var form = liger.get("capPayInfo_form");
		if (updInsLoan == '2' || updInsLoan == '1'){
			if (!form.valid()) {
				top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
				return false; //验证不通过，不执行以下代码
			}
		}
        var data = form.getData();
		data["loanInsCode"] = liger.get("loanInsCode").selectedValue;
		data["loanInsNm"] = liger.get("loanInsCode").selectedText;
        data["paySchId"]='${capPayInfoVO.paySchId}';
        data["updInsLoan"]='${updInsLoan}';
		data["isOutInsLoan"] = $("#isOutInsLoan").val();
		data["insLoanTm"] = $("#insLoanTm").val();
		data["insLoanSum"] = $("#insLoanSum").val();
		data["payerAccNo"] = $("#payerAccNo").val();
		data["payerBkNm"] = $("#payerBkNm").val();
        console.log(data);
        //data["payeeId"]=$("#payeeId").val();
        data['payeeList'] = JSON.stringify(getFieldsetsValues(fields, counts));
        var _url='<%=path%>/capital/capPayInfo/modify.do?id=' + _capPayId
        var wait_dialog;
        $.ajax({
            type: 'post',
            dataType: 'json',
            data: data,
            url: _url,
            beforeSend: function () {
                wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
            },
            success: function (msg) {
                wait_dialog.close();
                if (msg.success == 1) {
                    top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                    //var _payWayCd = data["payWayCd"];
                    var isNeedCallback = '${isNeedCallback}';
                    if(isNeedCallback==1){
	                  	//回调刷新列表
						 var callback=GET_W2Wcallback();
			             callback();
                    }
                } else {
                    $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                }
            }
        });
    }
	function getFieldsetsValues(fields, count) {
        var fieldsetValues = [];
        for (var i = 0; i < count.length; i++) {
            var values = _getValues(count[i]);
            if (values.bkId == '') {
                continue;
            }
            fieldsetValues.push(values);
        }
        return fieldsetValues;

        function _getValues(i) {
            var values = {};
            $.each(fields, function (index, val) {
                var el = document.getElementById(val + i);
                elID = el.id;
                ligerObj = liger.get(elID);
                value = '';
                if (ligerObj) {
                    value = ligerObj.getValue();
                } else {
                    value = el.value;
                }
                if(val == 'actPayAmt' && StringUtils.isNotEmpty(value)){
                    value = value * 100 ;
                }
                if(val == 'payAmt'){
                    value = value * 100 ;
                }
                //JSON.stringify日期过后时间不正确的解决方法
                if(val == 'actPayTms' && StringUtils.isNotEmpty(value)){
                    value = renderDate(value) ;
                }
                values[val] = value;
            });
            return values;
        }
    }

    //格式化时间
    function renderDate(value){
        var dateStr = "";
        if(null != value){
            var date = new Date(value);
            dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
        }
        return dateStr;
    }

    //取消放款
	function cancelPay(_capPayId){
		if(!_capPayId)return;
		
		$.ligerDialog.confirm("<span style='color: red;'>确定取消此支付表的放款吗?取消后无法恢复!</span>", function (flag) {
			if(flag == false)return;
			var wait_dialog;
			$.ajax({
				type: 'post',
				dataType:'json',
				data:{capPayId:_capPayId,processInstanceId:_proIntId},
				url: '<%=path%>/capPay/flow/cancelPay.do',
				beforeSend: function(){
				     wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING,SQ_type:"waitting"});
				},
				success:function(msg){
					wait_dialog.close();
					 if(msg.success == 1){
						 UIUtils.alertSuccess(msg.info);
						 //回调刷新列表
						 var callback=GET_W2Wcallback();
			             callback();
			             //关闭当前页
						 var TAB=top.mainApp.parentTab;
						 var currentTabid=TAB.getSelectedTabItemID();
			             top.tab.removeTabItem(currentTabid);
					 }else{
						 UIUtils.alertError(msg.info);
					 }
				}
			});
		});
	}
    
    //调资金系统发起付款
	function toSendPay(){
		var form = liger.get("capPayInfo_form");
        var data = form.getData();
        //data["payeeId"]=$("#payeeId").val();
        data['payeeList'] = JSON.stringify(getFieldsetsValues(fields, counts));
        var _url='<%=path%>/capital/capPayInfo/modify.do?id=' + _capPayId ;
        var wait_dialog;
        $.ajax({
            type: 'post',
            dataType: 'json',
            data: data,
            url: _url,
            beforeSend: function () {
                wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
            },
            success: function (msg) {
                if (msg.success == 1) {
                    //top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                    //var _payWayCd = data["payWayCd"];
                    var isNeedCallback = '${isNeedCallback}';
                    if(isNeedCallback==1){
	                  	//回调刷新列表
						 var callback=GET_W2Wcallback();
			             callback();
                    }
                    //调拜特
                    /* if(!_payeeId){
                		return;
                	} */
                	//像资金系统发送支付单信息
                	$.ajax({
                		type: 'post',
                		dataType:'json',
                		data:{
                			//payeeId:_payeeId,
                			capPayId:_capPayId 
                		},
                		url: '<%=path%>/capPay/flow/toSendPayV2.do',
                		success:function(msg){
                			wait_dialog.close();
                			 if(msg.success == 1){
               					 /* $.ligerDialog.SQalert({
            		                SQ_showButtons: true,
            		                SQ_onBtnclick: function (item, Dialog) {
            		                    //console.log(item, Dialog);
            		                },
            		                content: msg.info
            		         	 }); */
                				 UIUtils.alertSuccess(msg.info);
                				 window.location.reload();
                			 }else{
                				 //$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
                				 UIUtils.alertError(msg.info);
                			 }
                		}
                	});
                } else {
                    $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                }
            }
        });
    	
    }
	//当前tab刷新
	function callback() {
        window.location.reload();
    }
    /**新增上牌信息*/
    function addSp(_prjPrdDtlId){
    	if(!_prjPrdDtlId)return;
    	var detailFlag = false;
    	//调上牌维护页面 传递是否流程标识(isFlow=1)  是的话 页面执行
		Add_navTab( 'sp_info_add','添加上牌信息','<%=path%>/project/prjprdlicinfo/toAddPage.do?isFlow=1&detailFlag='+detailFlag+'&dtlId='+_prjPrdDtlId,callback);
    }
    /**修改上牌信息*/
    function modifySp(_prjPrdDtlId){
    	if(!_prjPrdDtlId)return;
    	var detailFlag = false;
    	//调上牌维护页面 传递是否流程标识(isFlow=1)  是的话 页面执行
		Add_navTab( 'sp_info_add','修改上牌信息','<%=path%>/project/prjprdlicinfo/toAddPage.do?isFlow=1&detailFlag='+detailFlag+'&dtlId='+_prjPrdDtlId+'&id='+_prjPrdDtlId,callback);
    }
    /**查看上牌信息*/
    function showSp(_prjPrdDtlId){
    	var detailFlag = true;
    	//调上牌维护页面 传递是否流程标识(isFlow=1)  是的话 页面执行
    	Add_navTab( 'sp_info_add','查看上牌信息','<%=path%>/project/prjprdlicinfo/toAddPage.do?isFlow=1&checkSp=${checkSp}&detailFlag='+detailFlag+'&dtlId='+_prjPrdDtlId+'&id='+_prjPrdDtlId+'&checkSpPass='+checkSpPass, callback);
    }
    /**新增抵押信息*/
    function addDy(_prjPrdDtlId){
    	if(!_prjPrdDtlId)return;
    	var detailFlag = false;
    	//调抵押维护页面 传递是否流程标识(isFlow=1)  是的话 页面执行
		Add_navTab( 'dy_info_add','添加抵押信息','<%=path%>/project/prjprdmtg/toAddPage.do?isFlow=1&detailFlag='+detailFlag+'&dtlId='+_prjPrdDtlId+'&canUpdateMtg=${canUpdateMtg}',callback);
    }
    /**修改抵押信息*/
    function modifyDy(_prjPrdDtlId){
    	if(!_prjPrdDtlId)return;
    	var detailFlag = false;
    	//调抵押维护页面 传递是否流程标识(isFlow=1)  是的话 页面执行
		Add_navTab( 'dy_info_add','修改抵押信息','<%=path%>/project/prjprdmtg/toAddPage.do?isFlow=1&detailFlag='+detailFlag+'&dtlId='+_prjPrdDtlId+'&id='+_prjPrdDtlId+'&canUpdateMtg=${canUpdateMtg}',callback);
    }
    /**查看抵押信息*/
    function showDy(_prjPrdDtlId){
    	var detailFlag = true;
    	//调抵押维护页面 传递是否流程标识(isFlow=1)  是的话 页面执行
    	Add_navTab( 'dy_info_add','查看抵押信息','<%=path%>/project/prjprdmtg/toViewPage.do?isFlow=1&checkDy=${checkDy}&detailFlag='+detailFlag+'&dtlId='+_prjPrdDtlId+'&id='+_prjPrdDtlId+'&canUpdateMtg=${canUpdateMtg}'+'&checkDyPass='+checkDyPass, callback);
    }
    //放款合同通过意见
    function contractOpnStart(){
    	var _opnTypCd = AuditConstant.AUD_PAY_OPN_TYP_CD_CONTRACT;
    	top.$.ligerDialog.open({
            width: 1000,
            height:400,
            title : '放款合同通过意见',
            url:'<%=path%>/audit/audPayPassOpinion/toModifyPage.do?capPayId='+_capPayId+'&proIntId='+_proIntId+'&opnTypCd='+_opnTypCd,
            buttons: [{
                    text: "保存", type: 'ok', cls: 'l-dialog-btn-ok',
                    onclick: function (item, Dialog) {
                        if (Dialog.onOk) Dialog.onOk();
                    }
                }, {
                    text: "预览", type: 'ok', cls: 'l-dialog-btn-ok',
                    onclick: function (item, Dialog) {
                        if (Dialog.preview) Dialog.preview();
                    }
                },{
                    text: "取消", type: 'cancel', cls: 'l-dialog-btn-no',
                    onclick: function (item, Dialog) {
                        if (Dialog.onCancel) Dialog.onCancel();
                    }
                }
            ]
        });
    }
    //放款抵押通过意见
    function mortGageOpnStart(){
    	var _opnTypCd = AuditConstant.AUD_PAY_OPN_TYP_CD_MORTGAGE;
    	top.$.ligerDialog.open({
            width: 1000,
            height:400,
            title : '放款抵押通过意见',
            url:'<%=path%>/audit/audPayPassOpinion/toModifyPage.do?capPayId='+_capPayId+'&proIntId='+_proIntId+'&opnTypCd='+_opnTypCd,
            buttons: [{
                    text: "保存", type: 'ok', cls: 'l-dialog-btn-ok',
                    onclick: function (item, Dialog) {
                        if (Dialog.onOk) Dialog.onOk();
                    }
                }, {
                    text: "预览", type: 'ok', cls: 'l-dialog-btn-ok',
                    onclick: function (item, Dialog) {
                        if (Dialog.preview) Dialog.preview();
                    }
                },{
                    text: "取消", type: 'cancel', cls: 'l-dialog-btn-no',
                    onclick: function (item, Dialog) {
                        if (Dialog.onCancel) Dialog.onCancel();
                    }
                }
            ]
        });
    }
    function rejOpnStart(){
    	var bookTypCd = AuditConstant.AUD_LOAN_BOOK_TYP_CD;//台账类型-放款驳回台账
    	var opinionTypeCd = AuditConstant.SYS_FLOW_REJ_RSN_TYP_CD_LOAN;//驳回意见类型-放款驳回
    	top.$.ligerDialog.open({
            width: 1000,
            height:400,
            title : '驳回意见',
            url:'<%=path%>/audit/audRejectOpinion/toAddPage.do?capPayId='+_capPayId+'&proIntId='+_proIntId+'&taskId='+_taskId+'&taskDefKey='+_taskDefKey+'&opinionTypeCd='+opinionTypeCd+'&bookTypCd='+bookTypCd+'&taskNm='+_taskNm,
            buttons: [{
                    text: "保存", type: 'ok', cls: 'l-dialog-btn-ok',
                    onclick: function (item, Dialog) {
                        if (Dialog.onOk) Dialog.onOk();
                    }
                }, {
                    text: "取消", type: 'cancel', cls: 'l-dialog-btn-no',
                    onclick: function (item, Dialog) {
                        if (Dialog.onCancel) Dialog.onCancel();
                    }
                }
            ]
        });
    }
    
    //客户详情
    function showCstDtl(_cstId){
        Add_navTab("InsPlcCstBscInfo_"+_cstId, "客户信息", '<%=path%>/customer/cstbscinfo/toCustDetailPage.do?id='+_cstId, null);
    }
    //项目详情
    function toPrjDetail(_projectId){
    	if(!_projectId)return;
    	Add_navTab("prjDetail"+_projectId, "项目信息", '<%=path%>/project/prjbscinfo/toModifyPage.do?detailFlag=true&id='+_projectId);
    }
    // 支付表详情
    function showPrjPrdPaySchDtl(){
    	var editFlag = true;
    	var prjId = '${capPayInfoVO.prjId}';
    	var id = '${capPayInfoVO.paySchId}';
    	var prjPrdDtlId = '${capPayInfoVO.prjPrdDtlId}';
    	var prjPrdId = '${capPayInfoVO.prjPrdId}';
    	Add_navTab('tab_prj_quat_prps'+id,'查看支付表','<%=path%>/project/prjprdpayschm/toAddPage.do?prjId='+prjId+'&&id='+id+'&&prjPrdDtlId='+prjPrdDtlId+'&&prjPrdId='+prjPrdId+'&&detailFlag='+editFlag);
    }
    
    //禁用页面所有
    function disabledAll(){
    	if(liger.get("isGrp")){
	    	liger.get("isGrp").setDisabled(true);
    	}
    	if(liger.get("isOtherNoPass")){
	    	liger.get("isOtherNoPass").setDisabled(true);
    	}
    	$("#isFstCol").attr("disabled","disabled");
    	/* if(liger.get("payeeTypCd")){
	    	liger.get("payeeTypCd").setDisabled(true);
    	}
    	if(liger.get("rcptUnt")){
	    	liger.get("rcptUnt").setDisabled(true);
    	}
    	if(liger.get("bkAccTypCd")){
	    	liger.get("bkAccTypCd").setDisabled(true);
    	}
    	if(liger.get("payeeBkNm")){
	    	liger.get("payeeBkNm").setDisabled(true);
    	}
    	if(liger.get("payeeBkNo")){
	    	liger.get("payeeBkNo").setDisabled(true);
    	}
    	if(liger.get("accNo")){
	    	liger.get("accNo").setDisabled(true);
    	} */
    	$("#payRem").setDisabled_ligerTextarea(true);
    	/*if(liger.get("fundUse")){
	    	liger.get("fundUse").setDisabled(true);
    	}*/
    	/* if(liger.get("actPayAmt")){
	    	liger.get("actPayAmt").setDisabled(true);
    	}
    	if(liger.get("payWayCd")){
	    	liger.get("payWayCd").setDisabled(true);
    	}
    	if(liger.get("actPayTm")){
	    	liger.get("actPayTm").setDisabled(true);
    	}
    	if(liger.get("payAmt")){
	    	liger.get("payAmt").setDisabled(true);
    	} */
    }
    //修改收款方信息-呈报人节点
    function enable1(){
    	console.log("enable1");
    	$("#isFstCol").removeAttr("disabled");
    	if(liger.get("payeeTypCd")){
	    	liger.get("payeeTypCd").setEnabled();
    	}
    	if(liger.get("rcptUnt")){
	    	liger.get("rcptUnt").setEnabled();
    	}
    	if(liger.get("bkAccTypCd")){
	    	liger.get("bkAccTypCd").setEnabled();
    	}
    	if(liger.get("payeeBkNm")){
	    	liger.get("payeeBkNm").setEnabled();
    	}
    	if(liger.get("payeeBkNo")){
	    	liger.get("payeeBkNo").setEnabled();
    	}
    	if(liger.get("accNo")){
	    	liger.get("accNo").setEnabled();
    	}
	    $("#payRem").setDisabled_ligerTextarea(false);
    }
    
    function submitCredit(){
    	var wait_dialog;
        $.ajax({
    		type: 'post',
    		dataType:'json',
    		url: '<%=path%>/project/audit/submitCredit.do?prjId=${capPayInfoVO.prjId}',
    		beforeSend: function(){
    	          wait_dialog=top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
    	     },
    		success:function(msg){
    			 wait_dialog.close();
    			 if(msg.success == 1){
    				 UIUtils.alertSuccessHold1(msg.info);
    				 window.location.reload();
    			 }else{
    				 UIUtils.alertErrorHold1(msg.info);
    			 }
    		}
    	});
    }
    //保存还款日
    function addDueDate(){
    	var _dueDate = $("#dueDate").val();
    	if(!_dueDate || _dueDate==" "){
    		top.$.ligerDialog.SQalert({content: "第一期还款日不能为空.", SQ_type: "warning"});
    		return;
    	}
    	var wait_dialog;
    	$.ajax({
    		type: 'post',
    		dataType:'json',
    		data:{
    			paySchId:'${capPayInfoVO.paySchId}',
    			prjId:'${capPayInfoVO.prjId}',
    			buOrgCd:'${capPayInfoVO.buOrgCd}',
    			dueDate:_dueDate
    		},
    		url: '<%=path%>/capPay/flow/addDueDate.do',
    		beforeSend: function(){
		          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		     },
    		success:function(msg){
    			 wait_dialog.close();
    			 if(msg.success == 1){
    				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
    			 }else{
    				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
    			 }
    		}
    	});
    }
    //紧急联系人初始化列表
	function addtoAddEmergencyContact(){
		var params = {};
		params = {prjId:prjId}
		$("#prjLinkManGrid").ligerGrid({
			url: '<%=path%>/project/prjlinkman/initList.do',
	    	method : 'get',
	    	parms:params,
	        columns: [
	             { display: '联系人姓名', name: 'lnkNm', minWidth: 140 ,editor: {type: 'text'},
	  	            	enabledSort:true},
	            { display: '联系电话', name: 'mp', minWidth: 100 ,editor: {type: 'text'},enabledSort:true},
	            { display: '性别', name: 'genderCdNm', minWidth: 140 ,
	         	    editor: {
                       type: 'select',
                       data: genderCdList,
                       valueField: 'key',
                       textField: 'value'
                   },
                   valueField: 'genderCd',
                   textField: 'genderCdNm',
                   render: function (item) {
                       return item.genderCdNm;
                   },
	            	enabledSort:true},
	            { display: '与承租人关系',
	            	    editor: {
	                       type: 'select',
	                       data: rlCdArr,
	                       valueField: 'key',
	                       textField: 'value'
	                   }, 
	                   valueField: 'rlCd',
	                   textField: 'rlCdNm',
	                   render: function (item) {
	                       return item.rlCdNm;
	                   },
	            	name: 'rlCdNm', minWidth: 140},
	            { display: '访谈记录', name: 'visRec',editor: {type: 'text'}, minWidth: 500}
	            
	        ],
	        onBeforeSubmitEdit: function (e) {//重新赋值,要不然选中后离开会把key显示在前端
                if (e.selected && e.column.columnname == "rlCdNm") {
                    e.record.rlCdId = e.value;
                    e.value = e.selected[e.column.editor.textField];
                    e.record.rlCd = e.record.rlCdId;
                }
                if (e.selected && e.column.columnname == "genderCdNm") {
                    e.record.genderCdId = e.value;
                    e.value = e.selected[e.column.editor.textField];
                    e.record.genderCd = e.record.genderCdId;
                }
            },
	        pageSize:10,
	        root:'rows',
	        record:'total',
	        hideLoadButton : true,
	        width: '100%',
	        heightDiff:-2,
	        checkbox:true,
	        enabledEdit: true,
	        allowUnSelectRow: true,
            alternatingRow: false,
	        rownumbers:true,
	        usePagerOnLessPagesize: false,
	    });
		urgentPrjLinkManGrid = liger.get("prjLinkManGrid");
	}
    //保存抵押权人名称
    function addpledgeeAuthNm(){
    	var pledgeeAuthNm = $('#pledgee Select option:selected') .val();//选中的值
    	 var wait_dialog;
    	$.ajax({
    		type: 'post',
			dataType:'json',
			data:{pledgeeAuthNm:pledgeeAuthNm,id:prjPrdDtlId},
			url:'<%=path%>/project/prjprdmtg/addpledgeeAuthNm.do',
			beforeSend: function(){
		          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		     },
		    success:function(msg){
				 wait_dialog.close();
				 if(msg.success == 1){
					 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
				 }else{
					 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
				 }
			}
    	})
    	
    }
	//保存紧急联系人信息
	function addLinkMan(){
		  var prjlinkManList = urgentPrjLinkManGrid.getData();
		var params = {};
		params.prjId = prjId;
		params.prjlinkManList = JSON.stringify(prjlinkManList);
	     var wait_dialog;
			$.ajax({
				type: 'post',
				dataType:'json',
				data:params,
				url: '<%=path%>/project/prjlinkman/add.do',
				beforeSend: function(){
			          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
			     },
				success:function(msg){
					 wait_dialog.close();
					 if(msg.success == 1){
						 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
						 urgentPrjLinkManGrid.reload();
					 }else{
						 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
					 }
				}
			});
	}
	//添加
	function addLinkManRow(){
		//添加担保人信息
	 	var manager = $("#prjLinkManGrid").ligerGetGridManager();
	      manager.addRow({
	      lnkNm:'',
		mp:'',
		genderCd:'',
		genderCdNm:'',
		rlCd:'',
		rlCdNm:'',
		visRec:'',
	     });
	}
	//删除紧急联系人
	$("#delBtn").click(function (event) {
		var linManIds =[] ;
		var  manager  = $("#prjLinkManGrid").ligerGetGridManager();
		var data = manager.getSelecteds();//获取选中行
		 if (data.length ==0) { alert('请选择行'); return; }
		 var parms=JSON.stringify(data);
		 $.ajax({
			 type: 'post',
				dataType:'json',
				data:{parms:parms},
				url:'<%=path%>/project/prjlinkman/delByLinkMans.do',
			 	beforeSend: function(){
			          wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
			     }, 
			     success:function(msg){
					 wait_dialog.close();
					 if(msg.success == 1){
						 $.ligerDialog.SQalert({content:"删除成功！", SQ_type: "success"});
						 urgentPrjLinkManGrid.reload();
						 
					 }else if(msg.data == null){
						 manager.deleteSelectedRow();
					     $.ligerDialog.SQalert({content:"删除成功！", SQ_type: "success"});
					 }else{
						 $.ligerDialog.SQalert({content:"删除失败！", SQ_type: "error"});
					 }
				}
		 })
	})
	  //紧急联系人初始化列表--查看
	function LooktoAddEmergencyContact(){
		var params = {};
		params = {prjId:prjId}
		$("#prjLinkManGrid").ligerGrid({
			url: '<%=path%>/project/prjlinkman/initList.do',
	    	method : 'get',
	    	parms:params,
	        columns: [
	             { display: '联系人姓名', name: 'lnkNm', minWidth: 140 ,
	  	            	enabledSort:true},
	            { display: '联系电话', name: 'mp', minWidth: 100 ,enabledSort:true},
	            { display: '性别', name: 'genderCdNm', minWidth: 140 ,
                   valueField: 'genderCd',
                   textField: 'genderCdNm',
                   render: function (item) {
                       return item.genderCdNm;
                   },
	            	enabledSort:true},
	            { display: '与承租人关系',
	                   valueField: 'rlCd',
	                   textField: 'rlCdNm',
	                   render: function (item) {
	                       return item.rlCdNm;
	                   },
	            	name: 'rlCdNm', minWidth: 140},
	            { display: '访谈记录', name: 'visRec', minWidth: 500}
	            
	        ],
	        onBeforeSubmitEdit: function (e) {//重新赋值,要不然选中后离开会把key显示在前端
                if (e.selected && e.column.columnname == "rlCdNm") {
                    e.record.rlCdId = e.value;
                    e.value = e.selected[e.column.editor.textField];
                    e.record.rlCd = e.record.rlCdId;
                }
                if (e.selected && e.column.columnname == "genderCdNm") {
                    e.record.genderCdId = e.value;
                    e.value = e.selected[e.column.editor.textField];
                    e.record.genderCd = e.record.genderCdId;
                }
            },
	        pageSize:10,
	        root:'rows',
	        record:'total',
	        hideLoadButton : true,
	        width: '100%',
	        heightDiff:-2,
	        checkbox:true,
	        enabledEdit: true,
	        allowUnSelectRow: true,
            alternatingRow: false,
	        rownumbers:true,
	        usePagerOnLessPagesize: false,
	    });
		urgentPrjLinkManGrid = liger.get("prjLinkManGrid");
	}
	 //后续回访
	  var visitId = "${visitId}";
	    function toFlowVisitAdd (){
	    	if(!visitId || visitId==""){
	    		top.$.ligerDialog.SQalert({content:"请先维护回访记录基本信息", SQ_type: "warning"});
	    		return;
	    	} 
	    	var isDetail = 0;
	    	$.ligerDialog.SQopen({
	            width: 1100,
	            height:500,
	            title : '后续回访记录',
	            url:'<%=path%>/audit/audReturnVisit/toFlowVisitAddPage.do?visitId='+visitId+'&projectId='+prjId+'&isDetail='+isDetail,
	            buttons: [{
	                    text: "保存", type: 'ok', cls: 'l-dialog-btn-ok',
	                    onclick: function (item, Dialog) {
	                        if (Dialog.onOk) Dialog.onOk();
	                    }
	                }, {
	                    text: "取消", type: 'cancel', cls: 'l-dialog-btn-no',
	                    onclick: function (item, Dialog) {
	                        if (Dialog.onCancel) Dialog.onCancel();
	                    }
	                }
	            ]
	        });
//	        Add_navTab("flowVisitInfo"+visitId, "后续回访记录", '<%=path%>/audit/audReturnVisit/toFlowVisitAddPage.do?visitId='+visitId+'&projectId='+_projectId+'&isDetail='+isDetail);
	    }
	    function LookFlowVisitAdd (){
	    	var isDetail = 1;
	    	$.ligerDialog.SQopen({
	            width: 1100,
	            height:500,
	            title : '后续回访记录',
	            url:'<%=path%>/audit/audReturnVisit/toFlowVisitAddPage.do?visitId='+visitId+'&projectId='+prjId+'&isDetail='+isDetail,
	            buttons: [{
	                    text: "保存", type: 'ok', cls: 'l-dialog-btn-ok',
	                    onclick: function (item, Dialog) {
	                        if (Dialog.onOk) Dialog.onOk();
	                    }
	                }, {
	                    text: "取消", type: 'cancel', cls: 'l-dialog-btn-no',
	                    onclick: function (item, Dialog) {
	                        if (Dialog.onCancel) Dialog.onCancel();
	                    }
	                }
	            ]
	        });
//	        Add_navTab("flowVisitInfo"+visitId, "后续回访记录", '<%=path%>/audit/audReturnVisit/toFlowVisitAddPage.do?visitId='+visitId+'&projectId='+_projectId+'&isDetail='+isDetail);
	    }
//设置起租日
function addLeaseDate(){
    var _dueDate = $("#leaseDate").val();
    if(!_dueDate || _dueDate==" "){
        top.$.ligerDialog.SQalert({content: "起租日不能为空.", SQ_type: "warning"});
        return;
    }
    var wait_dialog;
    $.ajax({
        type: 'post',
        dataType:'json',
        data:{
            paySchId:'${capPayInfoVO.paySchId}',
            prjId:'${capPayInfoVO.prjId}',
            buOrgCd:'${capPayInfoVO.buOrgCd}',
            dueDate:_dueDate
        },
        url: '<%=path%>/capPay/flow/addLeaseDate.do',
        beforeSend: function(){
            wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
        },
        success:function(msg){
            wait_dialog.close();
            if(msg.success == 1){
                top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
            }else{
                top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
            }
        }
    });
}

function visual(){
	// SEC-295 页面跳转调整
	Add_navTab('tab_spl_grp_memb_dev_amt_rankvisual' + ${prjId},'狮桥关联图谱','<%=path%>/knowledgeGraph/init/initGraphVisualPage.do?prjId=${prjId}&c_no=${certNo}&usrId=${currentUsrId}');
}

//请求信审整体资料数据，获取"信审遗留问题"字段值 (参数:项目ID)-JL-20190819
var audCreditInfoId = "";
function initAudRemainPro(){
	var mdf_AudRemainPro = "${mdf_AudRemainPro }";
	if(mdf_AudRemainPro != "1"){
		$("#audRemainPro").setDisabled_ligerTextarea(true); //禁用"信审遗留问题"-JL
	}
	var _projectId = "${capPayInfoVO.prjId }";
	if(!_projectId){
		return;
	}
   	var _url = '<%=path%>/audit/audCreditInfo/getAudCreditInfoByPrjId.do';
	$.ajax({
   		type: 'get',
   		dataType:'json',
   		data:{
   			projectId:_projectId
   		},
   		url: _url,
   		success:function(msg){
			if(msg.success == 1){
				$("#audRemainPro").val(msg.data.audRemainPro); //设置数据显示
				audCreditInfoId = msg.data.id; //信审整体资料主键
			}else{
				top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
			}
		}
	});
}
//保存"信审遗留问题"到"信审整体资料表"-JL-20190819
function saveAudRemainPro(){
	var audRemainPro = $("#audRemainPro").val();
	if (audRemainPro && audRemainPro.length > 250) {
		top.$.ligerDialog.SQalert({content: "信审遗留问题不能大于250个字符", SQ_type: "warning"});
		return false;
	}
	if(!audCreditInfoId){
		top.$.ligerDialog.SQalert({content:"信审整体资料主键为空异常！", SQ_type: "warning"});
		return;
	}
	var wait_dialog;
	$.ajax({
		type: 'post',
		dataType:'json',
		data:{
			id:audCreditInfoId,
			audRemainPro:audRemainPro
		},
		url: '<%=path%>/audit/audCreditInfo/modifyAudCreditInfo.do',
		beforeSend: function(){
			wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		},
		success:function(msg){
			 wait_dialog.close();
			 if(msg.success == 1){
				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "success"});
			 }else{
				 top.$.ligerDialog.SQalert({content:msg.info, SQ_type: "error"});
			 }
		}
	});
}

/**
 *  lcv -start
 */
//初始化担保人列表
function initGuarantorListLcv(){
	if(!prjId)return;
	guarantorGrid = $("#ligergrid_guarantor_lcv").ligerGrid({
		url: '<%=path%>/project/prjcstbscInfo/initGuarantorList.do',
		method: 'get',
		parms:{
			prjId:prjId,
			cstRlTyp:ProjectConstant.CST_RL_SPONSOR
		},
		columns: [
			{display: '担保人姓名', minWidth: 80,
				render: function (rowdata, rowindex, value){
					var h ='';
					if(_isAuditNode==1 && rowdata.cstTypCd==1){
						h+='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
						h+="'"+"reCstNm"+"','"+rowdata.cstNm+"')";
						h+='"><i class="sqBtnIco_1"></i></a>';
						h+='&nbsp;&nbsp;&nbsp;&nbsp;';
					}
					if(_isAuditNode==1 && rowdata.cstTypCd==2){
						h+='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
						h+="'"+"reCstNm"+"','"+rowdata.cstNm+"')";
						h+='"><i class="sqBtnIco_1"></i></a>';
						h+='&nbsp;&nbsp;&nbsp;&nbsp;';
					}
					h+='<a href="javascript:toGuarantorDetail(';
					h+=rowdata.id;
					h+=","+rowdata.cstTypCd;
					h+=')">'+rowdata.cstNm+'</a>';
					return h;
				}
			},
			{display: '担保人身份证号', name: '', minWidth: 80,
				render: function (rowdata, rowindex, value){
					var h='';
					if(StringUtils.isNotEmpty(rowdata.certNo)){
						if(_isAuditNode==1 ){
							h='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
							h+="'"+"reCertNo"+"','"+rowdata.certNo+"')";
							h+='"><i class="sqBtnIco_1"></i></a>';
							h+='&nbsp;&nbsp;&nbsp;&nbsp;';
							h+=rowdata.certNo;
						}else{
							h = ''+rowdata.certNo+'';
						}
					}
					return h;
				}
			},
			{display: '联系方式', minWidth: 80,
				render: function (rowdata, rowindex, value){
					var h = '';
					if(rowdata.cstNpBscInfoVO){
						var cstNpBscInfoVO = rowdata.cstNpBscInfoVO;
						if(cstNpBscInfoVO && StringUtils.isNotEmpty(cstNpBscInfoVO.mp1)){
							h = '' + cstNpBscInfoVO.mp1 + '';
						}else if(cstNpBscInfoVO && StringUtils.isNotEmpty(cstNpBscInfoVO.mp2)){
							h = '' + cstNpBscInfoVO.mp2 + '';
						}
					}else if(rowdata.cstCorpBscInfoVO){
						var cstCorpBscInfoVO = rowdata.cstCorpBscInfoVO;
						if(cstCorpBscInfoVO && StringUtils.isNotEmpty(cstCorpBscInfoVO.officeTel)){
							h = '' + cstCorpBscInfoVO.officeTel + '';
						}
					}
					if(_isAuditNode==1 && StringUtils.isNotEmpty(h)){
						var h1='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
						h1+="'"+"reMp1"+"','"+h+"')";
						h1+='"><i class="sqBtnIco_1"></i></a>';
						h1+='&nbsp;&nbsp;&nbsp;&nbsp;'+h;
						return h1;
					}
					return h;
				}
			},
			{display: '联系地址', minWidth: 80,
				render: function (rowdata, rowindex, value){
					var h = '';
					if(rowdata.cstNpBscInfoVO){
						var cstNpBscInfoVO = rowdata.cstNpBscInfoVO;
						if(cstNpBscInfoVO && StringUtils.isNotEmpty(cstNpBscInfoVO.homeAddr)){
							h = '' + cstNpBscInfoVO.homeAddr + '';
						}
					}else if(rowdata.cstCorpBscInfoVO){
						var cstCorpBscInfoVO = rowdata.cstCorpBscInfoVO;
						if(cstCorpBscInfoVO && StringUtils.isNotEmpty(cstCorpBscInfoVO.officeAddr)){
							h = '' + cstCorpBscInfoVO.officeAddr + '';
						}
					}
					if(_isAuditNode==1 && StringUtils.isNotEmpty(h)){
						var h1='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
						h1+="'"+"rePostAddr"+"','"+h+"')";
						h1+='"><i class="sqBtnIco_1"></i></a>';
						h1+='&nbsp;&nbsp;&nbsp;&nbsp;'+h;
						return h1;
					}
					return h;
				}
			},
			{display: '担保人婚姻状况', name: '', minWidth: 80,
				render: function (rowdata, rowindex, value){
					var h='';
					if(StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO) && StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO.marStsCdNm)){
						h = ''+rowdata.cstNpBscInfoVO.marStsCdNm+'';
					}
					return h;
				}
			},
			{display: '担保人配偶姓名', name: '', minWidth: 80,
				render: function (rowdata, rowindex, value){
					var h='';
					if(StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO) && StringUtils.isNotEmpty(rowdata.cstNpBscInfoVO.cstNpSocialRlVO)){
						h = ''+rowdata.cstNpBscInfoVO.cstNpSocialRlVO.rlNm+'';
					}
					if(_isAuditNode==1 && StringUtils.isNotEmpty(h)){
						var h1='<a class="sq-button-hasicon" href="javascript:toRePrjPageList(';
						h1+="'"+"reCstNm"+"','"+h+"')";
						h1+='"><i class="sqBtnIco_1"></i></a>';
						h1+='&nbsp;&nbsp;&nbsp;&nbsp;'+h;
						return h1;
					}
					return h;
				},
			},
			{display: '合同签署状态', name: 'conSignStsNm', minWidth: 80,
				render: function (rowdata, rowindex, value){
					var h='';
					if(StringUtils.isNotEmpty(rowdata.prjCstBscInfoVO.conSignStsNm)){
						h = ''+rowdata.prjCstBscInfoVO.conSignStsNm+'';
					}
					return h;
				}
			},
			{display: '担保属性', name: 'guaraTypCdNm', minWidth: 80,
				render: function (rowdata, rowindex, value){
					var h='';
					if(StringUtils.isNotEmpty(rowdata.prjCstBscInfoVO.guaraTypCdNm)){
						h = ''+rowdata.prjCstBscInfoVO.guaraTypCdNm+'';
					}
					return h;
				}
			},
			{display: '签署方式', name: 'cntTypCdNm', minWidth: 80,
				render: function (rowdata, rowindex, value){
					var h='';
					if(StringUtils.isNotEmpty(rowdata.prjCstBscInfoVO.cntTypCdNm) ){
						h = ''+rowdata.prjCstBscInfoVO.cntTypCdNm+'';
					}
					return h;
				}
			},
			getNpGuarColumnLcv()
		],
		onBeforeEdit: function (e) {},
		onBeforeShowData: function(){SetIframe_height();},
		onAfterShowData: function(){SetIframe_height();},
		pageSize:100,
		usePagerOnLessPagesize: false,
		root: 'rows',
		record: 'total',
		hideLoadButton: true,
		width: '100%',
		height: 300,
		heightDiff: -2,
		enabledEdit: true,
		isScroll: false,
		checkbox: false,
		rownumbers: true,
		allowUnSelectRow: true,
		alternatingRow: false
	});
	if(guaraStatusLcv == 2 || guaraStatusLcv == 3){
		guarantorGrid.toggleCol('conSignStsNm', true);
		guarantorGrid.toggleCol('guaraTypCdNm', true);
		guarantorGrid.toggleCol('cntTypCdNm', true);

	}else{
		guarantorGrid.toggleCol('conSignStsNm', false);
		guarantorGrid.toggleCol('guaraTypCdNm', false);
		guarantorGrid.toggleCol('cntTypCdNm', false);
	}
}
//获取操作列
function getNpGuarColumnLcv(){
	if (!(guaraStatusLcv == 2 || guaraStatusLcv == 3)){
		return ;
	}
	var column = {
		display: '操作',
		isSort: false,
		width: 280,
		align:'left',
		render: function (rowdata, rowindex, value){
			var h="";
			if(rowdata.id && rowdata.cstNpBscInfoVO){
				if((guaraStatusLcv==3) && (StringUtils.isEmpty(rowdata.prjCstBscInfoVO.conSignSts) || rowdata.prjCstBscInfoVO.conSignSts==0)){
					h+='<a class="sq-button-hasicon" href="javascript:removeBtnLcv(';
					h+="'"+rowdata.prjCstBscInfoVO.id+"',";
					h+= "'"+rowdata.prjCstBscInfoVO.isPushCon + "',";
					h+= "'"+rowdata.prjCstBscInfoVO.guaraTypCd + "'";
					h+=')"><i class="sqBtnIco_7"></i>删除</a>'
				}
				if((guaraStatusLcv==3 || guaraStatusLcv==2) && (StringUtils.isEmpty(rowdata.prjCstBscInfoVO.conSignSts) || rowdata.prjCstBscInfoVO.conSignSts==0)){
					h+='<a class="sq-button-hasicon" href="javascript:modifyNpGuarBtnLcv(';
					h+="'"+rowdata.prjCstBscInfoVO.id+"',";
					h+= "'"+rowdata.prjCstBscInfoVO.isPushCon + "',";
					h+="'"+rowdata.cstNpBscInfoVO.mp1+"',";
					h+=')"><i class="sqBtnIco_4"></i>修改</a>'
				}
				h+='<a class="sq-button-hasicon" href="javascript:detailNpGuarBtnLcv(';
				h+="'"+rowdata.prjCstBscInfoVO.id+"',";
				h+="'"+rowdata.cstNpBscInfoVO.mp1+"',";
				h+=')"><i class="sqBtnIco_2"></i>查看</a>'
				if (rowdata.prjCstBscInfoVO.cntTypCd==1 && (StringUtils.isEmpty(rowdata.prjCstBscInfoVO.conSignSts) || rowdata.prjCstBscInfoVO.conSignSts==0) && rowdata.prjCstBscInfoVO.isPushCon==0) {
					h+='<a class="sq-button-hasicon" href="javascript:pushConLcv(';
					h+="'"+rowdata.prjCstBscInfoVO.id+"',";
					h+="'"+rowdata.prjCstBscInfoVO.guaraTypCd+"'";
					h+=')"><i class="sqBtnIco_3"></i>推送合同</a>'
				}
			}
			if(rowdata.id && rowdata.cstCorpBscInfoVO){
				var h="";
				if(guaraStatusLcv==3){
					h+='<a class="sq-button-hasicon" href="javascript:removeBtnLcv(';
					h+="'"+rowdata.prjCstBscInfoVO.id+"',";
					h+=')"><i class="sqBtnIco_7"></i>删除</a>'

					h+='<a class="sq-button-hasicon" href="javascript:modifyCorpGuarBtnLcv(';
					h+="'"+rowdata.prjCstBscInfoVO.id+"',";
					h+="'"+rowdata.cstCorpBscInfoVO.cstCorpTeamVO.mnm+"',";
					if(rowdata.cstCorpBscInfoVO.cstCorpTeamVO.mp1){
						h+="'"+rowdata.cstCorpBscInfoVO.cstCorpTeamVO.mp1+"'";
					}else{
						h+="''";
					}
					h+=')"><i class="sqBtnIco_4"></i>修改</a>'

					// h+='<a class="sq-button-hasicon" href="javascript:investInfo(';
					// h+="'"+rowdata.cstId+"',";
					// h+="'"+rowdata.cstTypCd+"',";
					// h+="'"+rowdata.id+"',";
					// h+="'"+rowdata.cstRlCd+"'";
					// h+=')"><i class="sqBtnIco_4"></i>资信信息</a>'
				}
				h+='<a class="sq-button-hasicon" href="javascript:detailCorpGuarBtnLcv(';
				h+="'"+rowdata.prjCstBscInfoVO.id+"',";

				h+="'"+rowdata.cstCorpBscInfoVO.cstCorpTeamVO.mnm+"',";
				if(rowdata.cstCorpBscInfoVO.cstCorpTeamVO.mp1){
					h+="'"+rowdata.cstCorpBscInfoVO.cstCorpTeamVO.mp1+"'";
				}else{
					h+="''";
				}
				h+=')"><i class="sqBtnIco_2"></i>查看</a>'
			}
			return h;
		}
	}
	return column;
}
//查看担保人信息
function detailNpGuarBtnLcv(id,mp1){
	var  url = '<%=path%>/project/prjcstbscInfo/detailNpGuarPage.do?id='+id+'&&mp1='+mp1+'&&showGuarPart='+'1';//showGuarPart=1不展示部分担保人信息
	$.ligerDialog.SQopen({
		height:300,
		width: 800,
		title : '查看担保人信息',
		url: url,
		showMax: false,
		showToggle: true,
		showMin: false,
		isResize: true,
		slide: false,
	});
}
function addNpGuarLcv(){
	var cstRlFlag = ProjectConstant.CST_RL_SPONSOR;//担保人
	// var cstTypCd = ProjectConstant.CST_TYP_CD_NP;
	var url = '<%=path%>/project/prjbscinfo/toChoosePrjCstPageForLcv.do?cstRlFlag='+cstRlFlag;
	//+'&cstTypCd='+cstTypCd;
	var win = $.ligerDialog.SQopen({ title: '添加担保人',height: 600,width: 850, url: url, isResize: true });
}
//保存所选项目担保人信息
function addNpSelect(guarList,cstTypCd){
	if(!prjId){
		return;
	}
	var params = {};
	params.prjId = prjId;
	params.cstRlTyp =ProjectConstant.CST_RL_SPONSOR;
	params.prjCstBscInfo = JSON.stringify(guarList);
	var wait_dialog;
	$.ajax({
		type: 'post',
		dataType:'json',
		data:params,
		url: '<%=path%>/project/prjcstbscInfo/addSelectPrjCstBscInfo.do',
		beforeSend: function(){
			wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		},
		success:function(msg){
			wait_dialog.close();
			if(msg.success == 1){
				top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
				liger.get("ligergrid_guarantor_lcv").reload();
			}else{
				top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
			}
		}
	});
}
//保存所选项目担保人信息
function addLpSelect(guarList,cstTypCd){
	if(!prjId){
		return;
	}
	var params = {};
	params.prjId = prjId;
	params.cstRlTyp =ProjectConstant.CST_RL_SPONSOR;
	params.prjCstBscInfo = JSON.stringify(guarList);
	var wait_dialog;
	$.ajax({
		type: 'post',
		dataType:'json',
		data:params,
		url: '<%=path%>/project/prjcstbscInfo/addSelectPrjCstBscInfo.do',
		beforeSend: function(){
			wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
		},
		success:function(msg){
			wait_dialog.close();
			if(msg.success == 1){
				top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
				liger.get("ligergrid_guarantor_lcv").reload();
			}else{
				top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
			}
		}
	});
}
//修改担保人信息
function modifyNpGuarBtnLcv(id,isPushCon,mp1){
	if (_taskDefKey=="FLOW_00000001_001_001_001" || _taskDefKey=="FLOW_00000001_001_004_001"){//城配流程修改担保人时只能修改合同签署方式
		var  url = '<%=path%>/project/prjcstbscInfo/modifyNpGuarPage.do?id='+id+'&&mp1='+mp1+'&&showGuarPart='+'1'+'&&prjId='+prjId +'&&isPushCon='+isPushCon+'&&onlyConTyp='+'1';
	} else{
		var  url = '<%=path%>/project/prjcstbscInfo/modifyNpGuarPage.do?id='+id+'&&mp1='+mp1+'&&showGuarPart='+'2'+'&&prjId='+prjId +'&&isPushCon='+isPushCon;
	}
	$.ligerDialog.SQopen({
		height:300,
		width: 800,
		title : '修改担保人信息',
		url: url,
		showMax: false,
		showToggle: true,
		showMin: false,
		isResize: true,
		slide: false,
	});
}
//推送担保合同
function pushConLcv(id,guaraTypCd){
	if (!id){
		return;
	}
	var params = {};
	params.id = id;
	params.guaraTypCd = guaraTypCd;
	$.ajax({
		type: 'post',
		dataType:'json',
		data:params,
		url: '<%=path%>/project/prjcstbscInfo/pushCon.do',
		success:function(msg){
			if(msg.success == 1){
				if(cstTypCd=ProjectConstant.CST_TYP_CD_NP){
					liger.get("ligergrid_guarantor_lcv").reload();
				};
			}else{
				top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
			}
		}
	});
}
//删除所选项目客户信息
function removeBtnLcv(id,isPushCon,guaraTypCd){
	$.ligerDialog.SQconfirm(LogUtils.LOG_CMM_DELETE_CONFIRM, function (flag) {
		if(!id || id=="undefined"){
			var manager = $("#ligergrid_guarantor_lcv").ligerGetGridManager();
			manager.deleteSelectedRow();
			return;
		}
		if(flag == false)return;
		var params = {};
		params.guaraTypCd = guaraTypCd;
		params.prjId = prjId;
		params.isPushCon = isPushCon;
		params.id = id;
		$.ajax({
			type: 'post',
			dataType:'json',
			data:params,
			url: '<%=path%>/project/prjcstbscInfo/removeCstAndDelCont.do',
			success:function(msg){
				if(msg.success == 1){
					liger.get("ligergrid_guarantor_lcv").reload();
				}else{
					top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
				}
			}
		});
	});
}
function modifyCorpGuarBtnLcv(id,mnm,mp1){
	var  url = '<%=path%>/project/prjcstbscInfo/modifyCorpGuarPage.do?id='+id+'&&mnm='+mnm+'&&mp1='+mp1;
	$.ligerDialog.SQopen({
		height:300,
		width: 600,
		title : '修改担保人信息',
		url: url,
		showMax: false,
		showToggle: true,
		showMin: false,
		isResize: true,
		slide: false,
	});
}

function detailCorpGuarBtnLcv(id,mnm,mp1){
	var  url = '<%=path%>/project/prjcstbscInfo/detailCorpGuarPage.do?id='+id+'&&mnm='+mnm+'&&mp1='+mp1;
	$.ligerDialog.SQopen({
		height:300,
		width: 600,
		title : '查看担保人信息',
		url: url,
		showMax: false,
		showToggle: true,
		showMin: false,
		isResize: true,
		slide: false,
	});
}
/**
 *  lcv -end
 */
</script>
</body>
</html>
